Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More results in field-restricted search than with all_fields #56

Open
kermitt2 opened this issue Nov 27, 2016 · 0 comments
Open

More results in field-restricted search than with all_fields #56

kermitt2 opened this issue Nov 27, 2016 · 0 comments

Comments

@kermitt2
Copy link
Member

Something strange on my set of ~1000 documents: searching for "étude" with all fields gives 57 results while searching only in abstract gives 75 results.

screenshot from 2016-11-27 17-53-31

versus

screenshot from 2016-11-27 17-53-59

Corresponding (simplified) requests are as follow:

  • without field restriction
{
  "fields": [
    "_id",
    "repositoryDocId"
  ],
  "query": {
    "bool": {
      "should": [],
      "must": [
        {
          "query_string": {
            "default_field": "_all",
            "query": "étude",
            "default_operator": "AND"
          }
        }
      ],
      "must_not": []
    }
  },
  "size": 1
}
  • with field restriction
{
  "fields": [
    "_id",
    "repositoryDocId"
  ],
  "query": {
    "bool": {
      "should": [],
      "must": [
        {
          "query_string": {
            "fields": [
              "$teiCorpus.$teiHeader.$profileDesc.$abstract.$lang_en",
              "$teiCorpus.$teiHeader.$profileDesc.$abstract.$lang_fr",
              "$teiCorpus.$teiHeader.$profileDesc.$abstract.$lang_de"
            ],
            "query": "étude",
            "default_operator": "AND"
          }
        }
      ],
      "must_not": []
    }
  },
  "size": 10
}

Not really related: fields could also be written more compactly as follow (it was one reason of the lang post-fixed notation):

 "fields": [
   "$teiCorpus.$teiHeader.$profileDesc.$abstract.*"
 ],
Aazhar pushed a commit that referenced this issue Nov 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant