logo
down
shadow

Retrieve a document from elastic search by matching two fields


Retrieve a document from elastic search by matching two fields

By : user2948834
Date : November 15 2020, 06:54 AM
wish help you to fix your issue My data are stored in elastic search as shown below , Try this:
code :
BoolQueryBuilder boolQuery = new BoolQueryBuilder();
QueryBuilder queryBuilder1 = QueryBuilders.matchQuery("identifier.id", "22081070");
QueryBuilder queryBuilder2 = QueryBuilders.matchQuery("identifier.source", "source 1");

boolQuery.must(queryBuilder1).must(queryBuilder2);

SearchResponse searchResponse = client.prepareSearch("test-index")
                .setTypes("type").setQuery(boolQuery).execute().actionGet();


Share : facebook icon twitter icon
How to retrieve all document ids matching a search, in elastic search?

How to retrieve all document ids matching a search, in elastic search?


By : WannesVanBeeck
Date : March 29 2020, 07:55 AM
wish help you to fix your issue The elasticsearch not support return each and every doc match to you queries. Because it Ll overload the system. Instead of this.. Use scroll concept in elasticsearch.. It's lik cursor concept in db's..
http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/scan-scroll.html
How to retrieve all document with version n in elastic search

How to retrieve all document with version n in elastic search


By : markk
Date : March 29 2020, 07:55 AM
Elastic Search Fliter on two fields within same sub document

Elastic Search Fliter on two fields within same sub document


By : Nithinlal Penattil
Date : March 29 2020, 07:55 AM
I wish did fix the issue. You need to modify your mapping to indicate that specifications is a nested type.
Mapping like:
code :
"mappings": {
  "product": {
    "properties": {
      ...
      "specifications": {
        "type": "nested" 
      }
    }
  }
}
"bool": {
  "must": [{
    "nested": {
      "path": "specifications",
      "query": {
        "bool": {
          "must": [
            { "wildcard": { "specifications.first": "Test1*" }},
            { "term": { "specifications.value":  "yes" }} 
          ]
        }
      }
    },
    {
      "term": { "instock": "true" }
    }
  }]
}
Search document even when some fields are missing in elastic search

Search document even when some fields are missing in elastic search


By : akilu
Date : March 29 2020, 07:55 AM
Can we indexing all the fields in document in Elastic Search

Can we indexing all the fields in document in Elastic Search


By : y.lahrbi
Date : October 15 2020, 08:10 PM
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org