Commit 320d73c0 authored by litaolemo's avatar litaolemo

update

parent 75c8ebc1
......@@ -400,9 +400,9 @@ print(random.choice(query_Str_list))
class QuickstartUser(HttpUser):
@task
def hello_world(self):
data = """
{
"track_scores": true,
query = random.choice(query_Str_list)
data = {
"track_scores": True,
"query": {
"function_score": {
"query": {
......@@ -420,7 +420,7 @@ class QuickstartUser(HttpUser):
"should": [
{
"multi_match": {
"query": {query},
"query": query,
"type": "cross_fields",
"operator": "and",
"fields": [
......@@ -440,7 +440,7 @@ class QuickstartUser(HttpUser):
"path": "sku_list",
"query": {
"multi_match": {
"query": {query},
"query": query,
"fields": [
"sku_list.name^2",
"sku_list.new_sku_tags",
......@@ -492,7 +492,7 @@ class QuickstartUser(HttpUser):
"constant_score": {
"filter": {
"multi_match": {
"query": {query},
"query": query,
"fields": [
"sku_list.name",
"sku_list.new_sku_tags",
......@@ -513,7 +513,7 @@ class QuickstartUser(HttpUser):
{
"match": {
"sku_list.new_sku_name": {
"query": {query},
"query": query,
"analyzer": "gm_default_search",
"operator": "or"
}
......@@ -550,7 +550,7 @@ class QuickstartUser(HttpUser):
"post_tags": [
"</ems>"
],
"require_field_match": false,
"require_field_match": False,
"no_match_size": 200
}
}
......@@ -569,7 +569,7 @@ class QuickstartUser(HttpUser):
"must": [
{
"term": {
"is_online": true
"is_online": True
}
}
]
......@@ -587,7 +587,7 @@ class QuickstartUser(HttpUser):
"path": "sku_list",
"query": {
"multi_match": {
"query": {query},
"query": query,
"fields": [
"sku_list.sku_tags",
"sku_list.show_name",
......@@ -607,7 +607,7 @@ class QuickstartUser(HttpUser):
"match_phrase": {
"short_description_by_standard_analyzer": {
"analyzer": "standard",
"query": {query}
"query": query
}
}
},
......@@ -618,7 +618,7 @@ class QuickstartUser(HttpUser):
"match_phrase": {
"doctor.name_by_standard_analyzer": {
"analyzer": "standard",
"query": {query}
"query": query
}
}
},
......@@ -629,7 +629,7 @@ class QuickstartUser(HttpUser):
"match_phrase": {
"doctor.hospital.name_by_standard_analyzer": {
"analyzer": "standard",
"query": {query}
"query": query
}
}
},
......@@ -640,7 +640,7 @@ class QuickstartUser(HttpUser):
"match_phrase": {
"doctor.hospital.city_name_by_standard_analyzer": {
"analyzer": "standard",
"query": {query}
"query": query
}
}
},
......@@ -651,7 +651,7 @@ class QuickstartUser(HttpUser):
"match_phrase": {
"doctor.hospital.city_province_name_by_standard_analyzer": {
"analyzer": "standard",
"query": {query}
"query": query
}
}
},
......@@ -662,7 +662,7 @@ class QuickstartUser(HttpUser):
"match_phrase": {
"bak_closure_tags_by_standard_analyzer": {
"analyzer": "standard",
"query": {query}
"query": query
}
}
},
......@@ -673,7 +673,7 @@ class QuickstartUser(HttpUser):
"match_phrase": {
"doctor.hospital.officer_name_by_standard_analyzer": {
"analyzer": "standard",
"query": {query}
"query": query
}
}
},
......@@ -686,7 +686,7 @@ class QuickstartUser(HttpUser):
"query": {
"match_phrase": {
"sku_list.name_by_standard_analyzer": {
"query": {query},
"query": query,
"analyzer": "standard"
}
}
......@@ -698,7 +698,7 @@ class QuickstartUser(HttpUser):
{
"filter": {
"term": {
"short_description": {query}
"short_description": query
}
},
"weight": 1000
......@@ -706,7 +706,7 @@ class QuickstartUser(HttpUser):
{
"filter": {
"term": {
"doctor.name": {query}
"doctor.name": query
}
},
"weight": 1000
......@@ -714,7 +714,7 @@ class QuickstartUser(HttpUser):
{
"filter": {
"term": {
"doctor.hospital.name": {query}
"doctor.hospital.name": query
}
},
"weight": 1000
......@@ -722,7 +722,7 @@ class QuickstartUser(HttpUser):
{
"filter": {
"term": {
"doctor.hospital.city_name": {query}
"doctor.hospital.city_name": query
}
},
"weight": 1000
......@@ -730,7 +730,7 @@ class QuickstartUser(HttpUser):
{
"filter": {
"term": {
"doctor.hospital.city_province_name": {query}
"doctor.hospital.city_province_name": query
}
},
"weight": 1000
......@@ -738,7 +738,7 @@ class QuickstartUser(HttpUser):
{
"filter": {
"term": {
"bak_closure_tags": {query}
"bak_closure_tags": query
}
},
"weight": 1000
......@@ -746,7 +746,7 @@ class QuickstartUser(HttpUser):
{
"filter": {
"term": {
"doctor.hospital.officer_name": {query}
"doctor.hospital.officer_name": query
}
},
"weight": 1000
......@@ -754,7 +754,7 @@ class QuickstartUser(HttpUser):
{
"filter": {
"term": {
"sku_list.name": {query}
"sku_list.name": query
}
},
"weight": 1000
......@@ -851,14 +851,14 @@ class QuickstartUser(HttpUser):
"</ems>"
],
"fragment_size": 10000,
"require_field_match": false
"require_field_match": False
},"size":10
}
""".replace('{query}',random.choice(json.dumps(query_Str_list)))
heasers = {
"Content-Type": "application/x-www-form-urlencoded"
}
response = self.client.post('/gm-dbmw-service-read/_search',heasers=heasers,data=data, verify=False, auth=tuple(auth.split(':',1)))
response = self.client.post('/gm-dbmw-service-read/_search',json=data, verify=False, auth=tuple(auth.split(':',1)))
print(response.text)
# self.client.get("/hello")
# self.client.get("/world")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment