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

Projects
None yet
2 participants
@bogdan-dumitrescu
Copy link
Contributor

bogdan-dumitrescu commented Oct 11, 2013

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

bogdan-dumitrescu pushed a commit to bogdan-dumitrescu/elasticsearch that referenced this issue Oct 14, 2013

Bogdan Dumitrescu
Replaced hardcoded boolean value with correct parameter
Implemented changes suggested by review.

Closes elastic#3898

@javanna javanna closed this in 8991896 Oct 14, 2013

javanna added a commit that referenced this issue Oct 14, 2013

Replaced hardcoded boolean value with correct parameter
Implemented changes suggested by review.

Closes #3898

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Replaced hardcoded boolean value with correct parameter
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
You can’t perform that action at this time.