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
#!/bin/bash | |
# run this before feeding example documents | |
# create the collection | |
curl -XPUT -H 'Content-Type:application/json' 'http://localhost:2600/v1/gis' | |
# explicitly define the location field to be of type 'geo_point' | |
curl -XPUT -H 'Content-Type:application/json' 'http://localhost:2600/v1/gis/pin/_mapping' -d '{ | |
"pin" : { |
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
/* A simple search example using the Cloud9 API */ | |
(function($) { | |
/* create a query object */ | |
var query = c9.query.QueryString("message:hello"); | |
/* create a simple term filter that filters by user */ | |
var filter = c9.filter.TermFilter("user", "jsmith"); | |
/* compose the query and filter into a Lucene filterQuery */ |
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
<!doctype html> | |
<head> | |
<title>Simple Search</title> | |
<!-- Example search template using underscore.js --> | |
<script type="text/template" id="results"> | |
<% _.each(hits, function(hit) { %> | |
<li><%= hit._source.message %></li> | |
<% }); %> | |
</script> |
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
/* fullscale.examples.elasticjs */ | |
(function($) { | |
/* compose a BoolQuery out of several TermQuery objs */ | |
var boolQuery = evo.BoolQuery() | |
.must( | |
evo.TermQuery("message", "hello")) | |
.mustNot( | |
evo.TermQuery("message", "back")) | |
.should( |
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
<!doctype html> | |
<head> | |
<title>Simple Search</title> | |
<!-- Example search template using underscore.js --> | |
<script type="text/template" id="results"> | |
<% _.each(hits, function(hit) { %> | |
<li><%= hit._source.message %></li> | |
<% }); %> | |
</script> |
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
#!/bin/bash | |
# create index | |
curl -XPUT -H 'Content-Type:application/json' 'http://localhost:2600/v1/examples' | |
# setup mapping | |
curl -XPUT -H 'Content-Type:application/json' 'http://localhost:2600/v1/examples/nested/_mapping' -d '{ | |
"nested": { | |
"properties": { | |
"rows": { |
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
<!doctype html> | |
<head> | |
<title>Simple Search</title> | |
<!-- Example search template using underscore.js --> | |
<script type="text/template" id="results"> | |
<% _.each(hits.hits, function(hit) { %> | |
<li><%= hit.fields.amount %></li> | |
<% }); %> | |
</script> |
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
<!doctype html> | |
<head> | |
<title>Simple Search</title> | |
<!-- Example search template using underscore.js --> | |
<script type="text/template" id="results"> | |
<% _.each(hits.hits, function(hit) { %> | |
<li><%= hit._source.product %> - <%= hit._source.quantity %></li> | |
<% }); %> |
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
#!/bin/bash | |
# run this before feeding example documents | |
# create the collection | |
curl -XPUT -H 'Content-Type:application/json' 'http://localhost:2600/v1/restaurant' | |
# explicitly define the location field to be of type 'geo_point' | |
curl -XPUT -H 'Content-Type:application/json' 'http://localhost:2600/v1/restaurant/locations/_mapping' -d '{ | |
"locations" : { |
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
#!/bin/bash | |
# run this before feeding example documents | |
# create the collection | |
curl -XPUT -H 'Content-Type:application/json' 'http://localhost:2600/v1/restaurant' | |
# explicitly define the location field to be of type 'geo_point' | |
curl -XPUT -H 'Content-Type:application/json' 'http://localhost:2600/v1/restaurant/locations/_mapping' -d '{ | |
"locations" : { |
OlderNewer