Skip to content

Instantly share code, notes, and snippets.

@hossman
Created February 6, 2019 22:38
Show Gist options
  • Select an option

  • Save hossman/04b3c6ac3f92f084d9e17a3f6a75b82a to your computer and use it in GitHub Desktop.

Select an option

Save hossman/04b3c6ac3f92f084d9e17a3f6a75b82a to your computer and use it in GitHub Desktop.
bin/solr -e cloud -noprompt
curl -H 'Content-Type: application/json' 'http://localhost:8983/solr/gettingstarted/update/json/docs?commit=true' --data-binary '[{"id":"hoss", "features_t":"the quick brown fox jumped over the lazy dog"},{"id":"xxx","features_t":"the lazy dog hid from the quick brown fox"}]'
curl 'http://localhost:8983/solr/gettingstarted/select?q=features_t:%22brown+dog%22%7E100&indent=true'
{
"responseHeader":{
"zkConnected":true,
"status":0,
"QTime":10,
"params":{
"q":"features_t:\"brown dog\"~100",
"indent":"true"}},
"response":{"numFound":2,"start":0,"maxScore":0.097831085,"docs":[
{
"id":"hoss",
"features_t":"the quick brown fox jumped over the lazy dog",
"_version_":1624760514975367168},
{
"id":"xxx",
"features_t":"the lazy dog hid from the quick brown fox",
"_version_":1624760514977464320}]
}}
$ curl 'http://localhost:8983/solr/gettingstarted/select?q=%7B!complexphrase%7Dfeatures_t:%22brown+dog%22%7E100&indent=true'
{
"responseHeader":{
"zkConnected":true,
"status":0,
"QTime":33,
"params":{
"q":"{!complexphrase}features_t:\"brown dog\"~100",
"indent":"true"}},
"response":{"numFound":1,"start":0,"maxScore":0.097831085,"docs":[
{
"id":"hoss",
"features_t":"the quick brown fox jumped over the lazy dog",
"_version_":1624760514975367168}]
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment