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

No results are found with specific use case when using a custom word_delimiter filter #3898

Closed
bogdan-dumitrescu opened this issue Oct 11, 2013 · 0 comments

Comments

@bogdan-dumitrescu
Copy link

The problem only manifests when all of the following conditions are met:

  • a custom word delimiter is used when analyzing a string field
  • the query string query is used
  • use_dis_max parameter is set to false
  • more than one field is used for the query
  • query string contains a special character (like "." or "/")

This is how to reproduce the issue:

# create the index
curl -XPOST http://localhost:9200/test -d '{
  "settings": {
    "index": {
      "number_of_shards": 1,
      "number_of_replicas": 0
    },
    "analysis": {
      "analyzer": {
        "text_ascii": {
          "type": "custom",
          "tokenizer": "whitespace",
          "filter": ["asciifolding",
          "lowercase",
          "custom_word_delimiter"]
        }
      },
      "filter": {
        "custom_word_delimiter": {
          "type": "word_delimiter",
          "generate_word_parts": true,
          "generate_number_parts": false,
          "catenate_numbers": true,
          "catenate_words": false,
          "split_on_case_change": false,
          "split_on_numerics": false,
          "stem_english_possessive": false
        }
      }
    }
  },
  "mappings": {
    "person": {
      "properties": {
        "name": {
          "type": "string",
          "analyzer": "text_ascii"
        },
        "address": {
          "type": "string",
          "analyzer": "text_ascii"
        }
      }
    }
  }
}
'

# index the document
curl -XPUT 'http://localhost:9200/test/person/1' -d '{
    "name" : "bogdan mihai dumitrescu",
    "address" : "amsterdam"
}'

# search for the document with a dot in the query 
# expect one result to be returned, but this returns 0 hits
curl -XPOST 'http://localhost:9200/test/_search' -d '{
  "query": {
    "query_string": {
      "query": "bogdan.dumitrescu",
      "fields": ["name", "address"],
      "use_dis_max": false,
      "default_operator": "and",
      "analyzer": "text_ascii"
    }
  }
}'
@ghost ghost assigned javanna Oct 11, 2013
javanna pushed a commit that referenced this issue Oct 14, 2013
Implemented changes suggested by review.

Closes #3898
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Implemented changes suggested by review.

Closes elastic#3898
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants