Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update elasticsearch.md #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Week10/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@ Let's create a query and search for entries that contain the work "scaffolding"
When executing this query:

curl -XPOST http://localhost:9200/entries/_search -d '
quote> {
quote> "query":{
quote> "query_string": {
quote> "query": "scaffolding",
quote> "default_field" : "data"
quote> }
quote> }
quote> }'
{
"query":{
"query_string": {
"query": "scaffolding",
"default_field" : "data"
}
}
}'
{"took":3,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.095891505,"hits":[{"_index":"entries","_type":"entry","_id":"2","_score":0.095891505,"_source":{
"title": "Ruby on rails is just a bubble in bathtub",
"data": "Yeah, Ruby on rails is awesome, but scaffolding is not!",
Expand Down Expand Up @@ -372,4 +372,4 @@ The following code takes all executions in and looks at the properties key and t

We take both the key and token properties and tell elastic search to store these single fields as two properties. First as the original string which we say is not analyzed, which means that if we now query the propertie key by key.original_key then we are asking elastic to filter out where each key is exactly as it was when it got saved (ex. ```second.py-cool_function```).

On the other hand if we still want to be able to look it up in a clever way elastic has also saved the properties like it wants to. So if we query by key as before we'll get the key split up on dashes like the default mapping behavior wants to. You can read more about mapping [here](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html)
On the other hand if we still want to be able to look it up in a clever way elastic has also saved the properties like it wants to. So if we query by key as before we'll get the key split up on dashes like the default mapping behavior wants to. You can read more about mapping [here](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html)