I have the following index
curl -XPUT 'http://localhost:9200/test/' -d '{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
"containsText" : {
"tokenizer": "whitespace",
"filter": ["asciifolding", "lowercase", "autocomplete"]
}
},
"filter": {
"autocomplete": {"type": "edgeNGram", "min_gram": "1",
"max_gram": "100", "side": "front"}
}
},
"mappings": {
"program" : {
"properties" : {
"title": {"type" : "string", "store" : "yes",
"index" : "analyzed" , "term_vector" : "with_positions_offsets",
"analyzer" : "containsText"}
}
}
}
}'
curl -XPUT http://localhost:9200/test/program/1652094 -d '{
"title": "James Franco"
}'
So my question is why does this return a result?
curl -XGET http://localhost:9200/test/program/_search -d '{
"query" : {
"queryString" : {
"default_field" : "title",
"query" : "james i",
"analyzer" : "containsText"
}
}
}'
I don't want it to since it doesn't match on the last name. What do I
need to change to get my expected result?
I would like to have my query string analyzed the same way as my
indexed string.
If it helps -- I was able to do this is solr as such:
<fieldType name="containsText" class="solr.TextField"
positionIncrementGap="100">
Thanks,
Neil