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

[0.9.11] simple_query_string does not recognize fields by their nested name but only by index_name #5091

Closed
roytmana opened this issue Feb 12, 2014 · 1 comment
Assignees

Comments

@roytmana
Copy link

{
  simple_query_string: {
    query: 'hello world',
    fields:['award.title']
  }
}

returns no results while

{
  simple_query_string: {
    query: 'hello world',
    fields:['award_title']
  }
}

returns expected results. the issue is with fields:[] in first case I use logical (dot-notation) field name while ion the second I use actual lucene name (index_name in the mappings below)

"award": {
  "properties":{
            "title": {
              "type": "multi_field",
              "path": "just_name",
              "fields": {
                "title": {
                  "type": "string",
                  "index_analyzer": "stemmed",
                  "search_analyzer": "stemmed",
                  "index_options": "offsets",
                  "index_name": "award_title",
                  "boost": 3
                },
                "all": {
                  "type": "string",
                  "index_name": "i_all",
                  "boost": 3
                },
                "all_shingle": {
                  "type": "string",
                  "analyzer": "not_stemmed_shingle",
                  "index_name": "i_all_shingle",
                  "boost": 3
                },
                "all_stem": {
                  "type": "string",
                  "index_analyzer": "stemmed",
                  "search_analyzer": "stemmed",
                  "index_name": "i_all_stem",
                  "boost": 3
                }
              }
            }
...
  }
}
@dakrone
Copy link
Member

dakrone commented Feb 12, 2014

I'm guessing this is because XSimpleQueryParser uses Lucene's query creators, and Lucene doesn't resolve the field using the mapping (just a guess). I'll take a look at this.

@dakrone dakrone self-assigned this Feb 12, 2014
dakrone added a commit to dakrone/elasticsearch that referenced this issue Feb 13, 2014
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
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

Successfully merging a pull request may close this issue.

2 participants