resend xml
This commit is contained in:
parent
fb55a24b8d
commit
942e9957fb
@ -32,6 +32,7 @@ Analysis Configuration (elasticsearch.yml)
|
|||||||
-------------
|
-------------
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
{
|
{
|
||||||
"index" : {
|
"index" : {
|
||||||
"analysis" : {
|
"analysis" : {
|
||||||
@ -43,6 +44,7 @@ Analysis Configuration (elasticsearch.yml)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
Mapping Configuration
|
Mapping Configuration
|
||||||
@ -50,12 +52,17 @@ Mapping Configuration
|
|||||||
|
|
||||||
Here is a quick example:
|
Here is a quick example:
|
||||||
1.create a index
|
1.create a index
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
curl -XPUT http://localhost:9200/index
|
curl -XPUT http://localhost:9200/index
|
||||||
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
2.create a mapping
|
2.create a mapping
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
curl -XPOST http://localhost:9200/index/fulltext/_mapping -d'
|
curl -XPOST http://localhost:9200/index/fulltext/_mapping -d'
|
||||||
{
|
{
|
||||||
"fulltext": {
|
"fulltext": {
|
||||||
@ -81,7 +88,9 @@ curl -XPOST http://localhost:9200/index/fulltext/_mapping -d'
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
3.indexing some docs
|
3.indexing some docs
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
curl -XPOST http://localhost:9200/index/fulltext/1 -d'
|
curl -XPOST http://localhost:9200/index/fulltext/1 -d'
|
||||||
{content:"美国留给伊拉克的是个烂摊子吗"}
|
{content:"美国留给伊拉克的是个烂摊子吗"}
|
||||||
'
|
'
|
||||||
@ -100,7 +109,9 @@ curl -XPOST http://localhost:9200/index/fulltext/4 -d'
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
4.query with highlighting
|
4.query with highlighting
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
curl -XPOST http://localhost:9200/index/fulltext/_search -d'
|
curl -XPOST http://localhost:9200/index/fulltext/_search -d'
|
||||||
{
|
{
|
||||||
"query" : { "term" : { "content" : "中国" }},
|
"query" : { "term" : { "content" : "中国" }},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user