Created
February 15, 2012 18:54
-
-
Save mattweber/1838124 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index: | |
analysis: | |
analyzer: | |
string_lowercase: | |
tokenizer: keyword | |
filter: lowercase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# does not work | |
curl -XGET 'http://localhost:9200/test/type1/_search?pretty=true' -d '{ | |
"query":{ | |
"field":{ | |
"field1":{ | |
"query":"matt weber" | |
} | |
} | |
} | |
}' | |
# does not work | |
curl -XGET 'http://localhost:9200/test/type1/_search?pretty=true' -d '{ | |
"query":{ | |
"field":{ | |
"field1":{ | |
"query":"matt weber", | |
"analyzer":"string_lowercase" | |
} | |
} | |
} | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT 'http://localhost:9200/test' -d '{ | |
"mappings" : { | |
"type1" : { | |
"properties" : { | |
"field1" : { | |
"type" : "string", | |
"analyzer" : "string_lowercase" | |
} | |
} | |
} | |
} | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# does not work | |
curl -XGET 'http://localhost:9200/test/type1/_search?pretty=true' -d '{ | |
"query":{ | |
"query_string":{ | |
"query":"matt weber", | |
"fields":["field1"] | |
} | |
} | |
}' | |
# does not work | |
curl -XGET 'http://localhost:9200/test/type1/_search?pretty=true' -d '{ | |
"query":{ | |
"query_string":{ | |
"query":"matt weber", | |
"fields":["field1"], | |
"analyzer":"string_lowercase" | |
} | |
} | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT 'http://localhost:9200/test/type1/1' -d '{"field1":"Matt Weber"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# works with and without specifying the analyzer | |
curl -XGET 'http://localhost:9200/test/type1/_search?pretty=true' -d '{ | |
"query":{ | |
"text":{ | |
"field1":{ | |
"query":"matt weber" | |
} | |
} | |
} | |
}' |
kimchy
commented
Feb 15, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment