lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amrit Sarkar <sarkaramr...@gmail.com>
Subject Re: I want "john smi" to find "john smith" in my custom "fullname_s" field
Date Tue, 06 Jun 2017 11:46:43 GMT
Erik,

Thank you for correcting. Things I miss out on daily bases: _text_ :)

Amrit Sarkar
Search Engineer
Lucidworks, Inc.
415-589-9269
www.lucidworks.com
Twitter http://twitter.com/lucidworks
LinkedIn: https://www.linkedin.com/in/sarkaramrit2

On Tue, Jun 6, 2017 at 5:12 PM, Nick Way <nick@southeastpublishing.com>
wrote:

> Fantastic thank you so much; I now have 'fullname_s:#string.
> spacesescaped#*
> or email_s:#string.spacesescaped#*' which is working like a dream - thank
> you so much - really appreciate your help.
>
> Thank you also Amrit.
>
> Nick
>
> On 6 June 2017 at 10:40, Erik Hatcher <erik.hatcher@gmail.com> wrote:
>
> > Nick - try escaping the space, so that your query is q=fullname_s:john\
> > smi*
> >
> > However, whitespace and escaping is problematic.  There is a handy prefix
> > query parser, so this would work on a string field with spaces:
> >
> >     q={!prefix f=fullname_s}john smi
> >
> > note no trailing asterisk on that one.   Even better, IMO, is to separate
> > the query string from the query parser:
> >
> >     q={!prefix f=fullname_s v=$qq}&qq=john smi
> >
> >         Erik
> >
> > ----
> >
> > Amrit - the issue with your example below is that q=fullname_s:john smi*
> > parses “john” against fullname_s and “smi” as a prefix query against the
> > default field, not likely fullname_s.   Check your parsed query to see
> > exactly how it parsed.    It works for you because… magic!   (copyField *
> > => _text_)
> >
> >
> >
> >
> > > On Jun 6, 2017, at 5:14 AM, Amrit Sarkar <sarkaramrit2@gmail.com>
> wrote:
> > >
> > > Nick,
> > >
> > > "string" is a primitive data-type and the entire value of a field is
> > > indexed as single token. The regex matching happens against the tokens
> > for
> > > text fields and against the full content for string fields. So once a
> > piece
> > > of text is tokenized, there is no way to perform a regex query across
> > word
> > > boundaries.
> > >
> > > fullname_s:john smi* is working for me.
> > >
> > > {
> > >  "responseHeader":{
> > >    "zkConnected":true,
> > >    "status":0,
> > >    "QTime":16,
> > >    "params":{
> > >      "q":"fullname_s:john smi*",
> > >      "indent":"on",
> > >      "wt":"json"}},
> > >  "response":{"numFound":1,"start":0,"maxScore":1.0,"docs":[
> > >      {
> > >        "id":"1",
> > >        "fullname_s":"john smith",
> > >        "_version_":1569446064473243648}]
> > >  }}
> > >
> > > I am on Solr 6.5.0. What version you are on?
> > >
> > >
> > > Amrit Sarkar
> > > Search Engineer
> > > Lucidworks, Inc.
> > > 415-589-9269
> > > www.lucidworks.com
> > > Twitter http://twitter.com/lucidworks
> > > LinkedIn: https://www.linkedin.com/in/sarkaramrit2
> > >
> > > On Tue, Jun 6, 2017 at 1:30 PM, Nick Way <nick@southeastpublishing.com
> >
> > > wrote:
> > >
> > >> Hi - I have a Solr collection with a custom field "fullname_s" (a
> > string).
> > >>
> > >> I want "john smi" to find "john smith" (I lower-cased the names upon
> > >> indexing them)
> > >>
> > >> I have tried
> > >>
> > >> fullname_s:"john smi*"
> > >> fullname_s:john smi*
> > >> fullname_s:"john smi?"
> > >> fullname_s:john smi?
> > >>
> > >>
> > >> but nothing gives the expected result - am I missing something? I
> spent
> > >> hours on this one point yesterday so if anyone can please point me in
> > the
> > >> right direction I'd be really grateful.
> > >>
> > >> I'm using Solr with Adobe Coldfusion by the way but I think the
> > principles
> > >> are the same.
> > >>
> > >> Thank you!
> > >>
> > >> Nick
> > >>
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message