Created
July 31, 2012 02:08
-
-
Save JnBrymn/3212774 to your computer and use it in GitHub Desktop.
Creating Suggest As You Type for Solr
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
#!/usr/bin/env bash | |
#this is how to create suggest as you type for finding a name (searching over last and first names) | |
#the search is only issued upon 3 characters or more because too many results will come back otherwise. This is a search for "tho" which could be Thomas (a first name) or Thompson (a last name). | |
curl "http://localhost:8983/solr/select?indent=on&qf=first_name%20last_name&defType=edismax&facet=truel&facet.field=first_name&facet.field=last_name&facet.mincount=1&fl=first_name%20last_name&q=tho*&facet.prefix=tho" | |
#as soon as a space is issued notice the change in the facet.prefix | |
curl "http://localhost:8983/solr/select?indent=on&qf=first_name%20last_name&defType=edismax&facet=truel&facet.field=first_name&facet.field=last_name&facet.mincount=1&fl=first_name%20last_name&q=thomas+&facet.prefix=" | |
#starting the second name | |
curl "http://localhost:8983/solr/select?indent=on&qf=first_name%20last_name&defType=edismax&facet=truel&facet.field=first_name&facet.field=last_name&facet.mincount=1&fl=first_name%20last_name&q=thomas+r*&facet.prefix=r" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment