Hello - I am attempting to run a ngram test using elastics 0.90.9.  I was 
able to replicate the problem I am having in our production system by 
following the example from here:

http://blog.rnf.me/2013/exact-substring-search-in-elasticsearch.html

The Mappings looks like this:

{
    "mappings": {
        "homes": {
            "properties": {
                "desc": {
                    "type": "string",
                    "index_analyzer": "index_ngram",
                    "search_analyzer": "search_ngram"
                }
            }
        }
    },
    "settings": {
        "analysis": {
            "filter": {
                "desc_ngram": {
                    "type": "ngram",
                    "min_gram": 3,
                    "max_gram": 8
                }
            },
            "analyzer": {
                "index_ngram": {
                    "type": "custom",
                    "tokenizer": "keyword",
                    "filter": [ "desc_ngram", "lowercase" ]
                },
                "search_ngram": {
                    "type": "custom",
                    "tokenizer": "keyword",
                    "filter": "lowercase"
                }
            }
        }
    }
}

The mapping is set up as follows:

curl -s -XPUT 'localhost:9200/listings' -d @settings.json

Three records are inserted into the index as follows:


curl -s -XPUT 'localhost:9200/listings/homes/1' -d '{ "desc": "This is a 
lovely home with a large yard." }'
curl -s -XPUT 'localhost:9200/listings/homes/2' -d '{ "desc": "This large 
fixer-upper has a gravelly yard." }'
curl -s -XPUT 'localhost:9200/listings/homes/3' -d '{ "desc": "A colonial 
mansion with a large yard and a pool." }'



The Search looks like this:
curl -s -XGET 'localhost:9200/listings/homes/_search?pretty=true' -d '{ 
"query" : { "bool" : { "must" : [ { "match" : { "desc" : { "query" : "large 
ya", "type" : "phrase" } } }, { "match" : { "desc" : { "query" : "arge 
yar", "type" : "phrase" } } }, { "match" : { "desc" : { "query" : "rge 
yard", "type" : "phrase" } } } ] } } }';



The problem is no results are returned.  Any input that can be given for a 
solution would be appreciated.

Thank you!








-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/4bee1be0-7ee4-4667-b4f7-b51371963928%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to