Created
December 14, 2011 20:05
-
-
Save sbrauer/1478233 to your computer and use it in GitHub Desktop.
trying to use standard_html_strip in ElasticSearch
This file contains hidden or 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/foo | |
{"ok":true,"acknowledged":true} | |
$ curl -XPUT http://localhost:9200/foo/bar/_mapping -d '{ | |
"properties" : { | |
"body": {"type":"string", "analyzer":"standard_html_strip"} | |
} | |
}' | |
{"ok":true,"acknowledged":true} | |
$ curl -XPUT http://localhost:9200/foo/bar/1 -d '{ | |
"body": "<p>This is a <strong>test</strong>.</p>" | |
}' | |
{"ok":true,"_index":"foo","_type":"bar","_id":"1","_version":1} | |
$ curl -XGET http://localhost:9200/foo/bar/_search?q=body:strong | |
{"took":35,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.18985549,"hits":[{"_index":"foo","_type":"bar","_id":"1","_score":0.18985549, "_source" : { | |
"body": "<p>This is a <strong>test</strong>.</p>" | |
}}]}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment