Working on Elastic Search 6.5.x. I indexed the documents into ES index via external web crawler. Below is my Index. I want to get the records based on the filter. If I use the below query, Suppose if I use term query by https the http results are not displaying same for the http. How can I compare records of an URL field after the protocol. If it has same info how can I display either one of the record with remaining unique records.
Index:
"title": "About elastic search"
"content": "Elasticsearch is an open source distributed, RESTful search and analytics engine capable of solving a growing number of use cases."
"URL: "https://www.elastic.co/webinars/getting-started-elasticsearch"`
"title":"About elastic search"
"content":"Elasticsearch is an open source distributed, RESTful search and analytics engine capable of solving a growing number of use cases."
"URL":"http://www.elastic.co/webinars/getting-started-elasticsearch"
"title":"About Similarity"
"content":"A similarity (scoring / ranking model) defines how matching documents are scored. Similarity is per field, meaning that via the mapping one can define a different similarity per field."
"URL":"https://www.elastic.co/guide/en/elasticsearch/reference/6.2/index-modules-similarity.html"
"title":"SQL Access"
"content":"This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features."
"URL":"http://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-sql.html"
Query:
GET test-index/_search
{
"query":{
"bool":{
"must":{
"query_string":{
"query":"test"
}
},
"filter": {
"bool" : {
"must" :
{"term" : { "url" : "https" } }
}}
}
}
}