Created
March 8, 2012 19:43
-
-
Save anonymous/2002929 to your computer and use it in GitHub Desktop.
Elasticsearch url search
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
1) If pages index already exists delete it | |
curl -XDELETE http://localhost:9200/pages | |
1) Configure and create index | |
curl -XPUT http://localhost:9200/pages/ -d " | |
index : | |
analysis: | |
analyzer: | |
default_index: | |
filter: [standard, lowercase ] | |
tokenizer: uax_url_email | |
default_search: | |
tokenizer: uax_url_email | |
filter: [standard, lowercase]" | |
2) Configuration appears to be working as a single token is returned in each case | |
curl http://localhost:9200/pages/_analyze?text=http://elasticsearch.org | |
curl http://localhost:9200/pages/_analyze?text=kimchy@elasticsearch.org | |
3) Add searchable data | |
curl -XPUT localhost:9200/pages/page/1 -d '{ | |
"content" : "use http://elasticsearch.org for search and email kimchy@elasticsearch.org for questions." | |
}' | |
4) Search for email returns result but url doesnot | |
curl http://localhost:9200/pages/_search?q=http://elasticsearch.org | |
curl http://localhost:9200/pages/_search?q=kimchy@elasticsearch.org |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment