You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by OTH <om...@gmail.com> on 2017/04/17 13:42:36 UTC

Need help with Query Syntax

If I submit the query:
 "select?q=field:*san*"
Then it works as expected; returning all values in the field which contain
the string "san".

However if I submit:
"select?q=field:*san *"
It then seems to return all the values of the field, regardless of what the
value is (!)

I only wish in this case to get the values which contain the string "san ",
but I'm unable to achieve that.

Thanks

Re: Need help with Query Syntax

Posted by OTH <om...@gmail.com>.
Ok.  What analyzer / fieldtype should I use to be able to search across
tokens?
Basically, I'm just trying to replicate the functionality of the
AnalyzingInfixLookupFactor Suggester, but I need to do it using a regular
index, because I need to utilize multiple fields using edismax bq, which
seems to not be possible with the Suggester
Thanks

On Mon, Apr 17, 2017 at 10:46 PM, Binoy Dalal <bi...@gmail.com>
wrote:

> Use the analyser available in the solr admin console to find out exactly
> how your query is analysed. That should give you a lot more information.
>
> On Mon 17 Apr, 2017, 21:58 OTH, <om...@gmail.com> wrote:
>
> > Ok, I get it now, it's because the field has been indexed as tokens.  So
> > maybe I should use a field which does not have a tokenizer index?  I'll
> try
> > something like that.  Thanks
> >
> > On Mon, Apr 17, 2017 at 9:16 PM, OTH <om...@gmail.com> wrote:
> >
> > > The field type is "text_general".
> > >
> > > On Mon, Apr 17, 2017 at 7:15 PM, Binoy Dalal <bi...@gmail.com>
> > > wrote:
> > >
> > >> I think it returns everything because your query matches *san or " *".
> > >> What is your field type definition?
> > >>
> > >> On Mon 17 Apr, 2017, 19:12 OTH, <om...@gmail.com> wrote:
> > >>
> > >> > If I submit the query:
> > >> >  "select?q=field:*san*"
> > >> > Then it works as expected; returning all values in the field which
> > >> contain
> > >> > the string "san".
> > >> >
> > >> > However if I submit:
> > >> > "select?q=field:*san *"
> > >> > It then seems to return all the values of the field, regardless of
> > what
> > >> the
> > >> > value is (!)
> > >> >
> > >> > I only wish in this case to get the values which contain the string
> > >> "san ",
> > >> > but I'm unable to achieve that.
> > >> >
> > >> > Thanks
> > >> >
> > >> --
> > >> Regards,
> > >> Binoy Dalal
> > >>
> > >
> > >
> >
> --
> Regards,
> Binoy Dalal
>

Re: Need help with Query Syntax

Posted by Binoy Dalal <bi...@gmail.com>.
Use the analyser available in the solr admin console to find out exactly
how your query is analysed. That should give you a lot more information.

On Mon 17 Apr, 2017, 21:58 OTH, <om...@gmail.com> wrote:

> Ok, I get it now, it's because the field has been indexed as tokens.  So
> maybe I should use a field which does not have a tokenizer index?  I'll try
> something like that.  Thanks
>
> On Mon, Apr 17, 2017 at 9:16 PM, OTH <om...@gmail.com> wrote:
>
> > The field type is "text_general".
> >
> > On Mon, Apr 17, 2017 at 7:15 PM, Binoy Dalal <bi...@gmail.com>
> > wrote:
> >
> >> I think it returns everything because your query matches *san or " *".
> >> What is your field type definition?
> >>
> >> On Mon 17 Apr, 2017, 19:12 OTH, <om...@gmail.com> wrote:
> >>
> >> > If I submit the query:
> >> >  "select?q=field:*san*"
> >> > Then it works as expected; returning all values in the field which
> >> contain
> >> > the string "san".
> >> >
> >> > However if I submit:
> >> > "select?q=field:*san *"
> >> > It then seems to return all the values of the field, regardless of
> what
> >> the
> >> > value is (!)
> >> >
> >> > I only wish in this case to get the values which contain the string
> >> "san ",
> >> > but I'm unable to achieve that.
> >> >
> >> > Thanks
> >> >
> >> --
> >> Regards,
> >> Binoy Dalal
> >>
> >
> >
>
-- 
Regards,
Binoy Dalal

Re: Need help with Query Syntax

Posted by OTH <om...@gmail.com>.
Ok, I get it now, it's because the field has been indexed as tokens.  So
maybe I should use a field which does not have a tokenizer index?  I'll try
something like that.  Thanks

On Mon, Apr 17, 2017 at 9:16 PM, OTH <om...@gmail.com> wrote:

> The field type is "text_general".
>
> On Mon, Apr 17, 2017 at 7:15 PM, Binoy Dalal <bi...@gmail.com>
> wrote:
>
>> I think it returns everything because your query matches *san or " *".
>> What is your field type definition?
>>
>> On Mon 17 Apr, 2017, 19:12 OTH, <om...@gmail.com> wrote:
>>
>> > If I submit the query:
>> >  "select?q=field:*san*"
>> > Then it works as expected; returning all values in the field which
>> contain
>> > the string "san".
>> >
>> > However if I submit:
>> > "select?q=field:*san *"
>> > It then seems to return all the values of the field, regardless of what
>> the
>> > value is (!)
>> >
>> > I only wish in this case to get the values which contain the string
>> "san ",
>> > but I'm unable to achieve that.
>> >
>> > Thanks
>> >
>> --
>> Regards,
>> Binoy Dalal
>>
>
>

Re: Need help with Query Syntax

Posted by OTH <om...@gmail.com>.
The field type is "text_general".

On Mon, Apr 17, 2017 at 7:15 PM, Binoy Dalal <bi...@gmail.com> wrote:

> I think it returns everything because your query matches *san or " *".
> What is your field type definition?
>
> On Mon 17 Apr, 2017, 19:12 OTH, <om...@gmail.com> wrote:
>
> > If I submit the query:
> >  "select?q=field:*san*"
> > Then it works as expected; returning all values in the field which
> contain
> > the string "san".
> >
> > However if I submit:
> > "select?q=field:*san *"
> > It then seems to return all the values of the field, regardless of what
> the
> > value is (!)
> >
> > I only wish in this case to get the values which contain the string "san
> ",
> > but I'm unable to achieve that.
> >
> > Thanks
> >
> --
> Regards,
> Binoy Dalal
>

Re: Need help with Query Syntax

Posted by Binoy Dalal <bi...@gmail.com>.
I think it returns everything because your query matches *san or " *".
What is your field type definition?

On Mon 17 Apr, 2017, 19:12 OTH, <om...@gmail.com> wrote:

> If I submit the query:
>  "select?q=field:*san*"
> Then it works as expected; returning all values in the field which contain
> the string "san".
>
> However if I submit:
> "select?q=field:*san *"
> It then seems to return all the values of the field, regardless of what the
> value is (!)
>
> I only wish in this case to get the values which contain the string "san ",
> but I'm unable to achieve that.
>
> Thanks
>
-- 
Regards,
Binoy Dalal

Re: Need help with Query Syntax

Posted by OTH <om...@gmail.com>.
I tried that, but it returned no results.
I understand now that the issue is that since the field has been tokenized
- searching for "*san\ *" will try to search for individual tokens which
contain the string sequence "san ", and so of course it won't find any.
I think I've found another workaround though which might work for me.
Thanks

On Tue, Apr 18, 2017 at 12:56 AM, Mikhail Khludnev <mk...@apache.org> wrote:

> This can be done with escaping space
> select?q=field:*san\ *
> Probably sow=false in new version might also helo
>
>
> On Mon, Apr 17, 2017 at 4:42 PM, OTH <om...@gmail.com> wrote:
>
> > If I submit the query:
> >  "select?q=field:*san*"
> > Then it works as expected; returning all values in the field which
> contain
> > the string "san".
> >
> > However if I submit:
> > "select?q=field:*san *"
> > It then seems to return all the values of the field, regardless of what
> the
> > value is (!)
> >
> > I only wish in this case to get the values which contain the string "san
> ",
> > but I'm unable to achieve that.
> >
> > Thanks
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>

Re: Need help with Query Syntax

Posted by Mikhail Khludnev <mk...@apache.org>.
This can be done with escaping space
select?q=field:*san\ *
Probably sow=false in new version might also helo


On Mon, Apr 17, 2017 at 4:42 PM, OTH <om...@gmail.com> wrote:

> If I submit the query:
>  "select?q=field:*san*"
> Then it works as expected; returning all values in the field which contain
> the string "san".
>
> However if I submit:
> "select?q=field:*san *"
> It then seems to return all the values of the field, regardless of what the
> value is (!)
>
> I only wish in this case to get the values which contain the string "san ",
> but I'm unable to achieve that.
>
> Thanks
>



-- 
Sincerely yours
Mikhail Khludnev