Home Software Consultant

Exploring slop with Elastic Search

2021-06-07T06:54:35+00:00

I came across the word slop on this issue of the tantivy search engine built in rust. I googled and found this link . So, to explore it by doing, I performed these steps on Ubuntu 18.04 -

curl -H "Content-Type: application/json" -XPUT 127.0.0.1:9200/store -d '
 { 
 "mappings": { 
 "properties" : { 
 "type": { "type": "keyword" },
 "name": { "type": "text"},
 "price": { "type": "double"},
 "quantity": { "type": "integer"},
 "department": { "type": "keyword"} 
 }
 } 
 } 

'
curl -H "Content-Type: application/json" -POST 127.0.0.1:9200/store/_doc/ -d '
 { 
 "type": "products",
 "name": "milk 1 gallon vanill soy",
 "price": "8.99",
 "quantity": "4",
 "department": "Packaged Foods"
 }
'
curl -H "Content-Type: application/json" -XGET 127.0.0.1:9200/store/_search?pretty -d '{
"query": {
"match_phrase": {
"name": { "query": "1 gallon milk"}
}}}
'
curl -H "Content-Type: application/json" -XGET 127.0.0.1:9200/store/_search?pretty -d '{
"query": {
"match_phrase": {
"name": { "query": "1 gallon milk", "slop":1}
}}}
'