Hi, I think you are after indexing tokens with begin/end markers. e.g. "This is a sample string" becomes: _This$ _is$ _a$ _sample$ _string$ + (edge) ngrams of the above tokens
Then a query for /This string/ could become: _This$^100 _string$^100 this string (or something along those lines) So this will match documents with "praying mantis" or "thisle" if you've ngrammed the tokens during indexing, but docs with the proper words "this" and "string" will be stronger matches because of the ^100 part. Otis -- Solr & ElasticSearch Support -- http://sematext.com/ On Mon, Jun 17, 2013 at 3:46 AM, Daniel Mosesson <daniel.moses...@ipreo.com> wrote: > What I am looking to do is take field that contains a string like (called > name for example): > > "This is a sample string" > > and then query by that field so that a search for "This" gets x points (exact > match), "sam" gets y points (partial match). > > I attempted to do this via the sort and query parameters, like so: > > sort=if(name==This,100,50) but this gives me an error: > sort param could not be parsed as a query, and is not a field that exists in > the index: if(name==This,100,50) > > Full URL: > http://localhost:8983/solr/db/select?q=name%3A*&sort=if(name%3D%3D%22This%22%2C100%2C50)+asc&fl=price%2Cname&wt=xml&indent=true > > Is there a way to do this? > > Note: I believe that I can at least get the documents that need to be sorted > via (name:This AND name:This*) but then I do not know where to go from there > (as I can't seem to get sort working for any functions). > > Can anyone provide some examples for how to do this kind of thing? > > Thank you. > > ________________________________ > > ****************************************************************** > This e-mail message and any attachments are confidential. Dissemination, > distribution or copying of this e-mail or any attachments by anyone other > than the intended recipient is prohibited. If you are not the intended > recipient, please notify Ipreo immediately by replying to this e-mail, and > destroy all copies of this e-mail and any attachments. Thank you! > ******************************************************************