[NSFW] search based on tag slug
-
Hi I want to configure tag slug as well with tag name for search, because tag names are changed sometimes so i want write query with tag slug,
could you please help how can i configure that.
sample query:
GET /my_branch/_search
{“from”:0,”size”:20,”_source”:[“id”,”type”,”title”,”date”,”author”,”author_str”,”tags”],”sort”:{“displaydate”:”desc”},”query”:{“bool”:{“filter”:{“bool”:{“must”:[{“bool”:{“must”:[{“terms”:{“tags”:[“here_i_want_to_add_search based on_tag_slug“]}}]}}]}},”must”:[{“term”:{“type”:”post”}}]}}}Input tag is Anti semitism
here is the output:
{ "_index": "my_branch", "_id": "422442", "_score": null, "_source": { "id": 422442, "type": "post", "title": "The Israel-Hamas war has left Britain divided", "author": "Andrew Marr", "date": "2023-10-18T16:38:58Z", "tags": [ "Anti semitism", "Conservatives", "Hamas", "Israel", "Labour", "Magazine", "Sponsored" ], "author_str": [ "andrew_marr" ] }, "sort": [ 1697650738000 ] },
But i want to consider tag slug i.e anti-semitism for search.
- This topic was modified 10 months, 4 weeks ago by .
- This topic was modified 10 months, 4 weeks ago by .
The page I need help with: [log in to see the link]
- The topic ‘[NSFW] search based on tag slug’ is closed to new replies.