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 Mysurf Mail <st...@gmail.com> on 2013/07/23 15:26:41 UTC
filter query result by user
I want to restrict the returned results to be only the documents that were
created by the user.
I then load to the index the createdBy attribute and set it to index
false,stored="true"
<field name="CreatedBy" type="string" indexed="false" stored="true"
required="true"/>
then in the I want to filter by "CreatedBy" so I use the dashboard, check
edismax and add
I check edismax and add CreatedBy:user1 to the qf field.
the result query is
http://
....:8983/solr/vault/select?q=*%3A*&defType=edismax&qf=CreatedBy%3Auser1
Nothing is filtered. all rows returned.
What was I doing wrong?
Re: filter query result by user
Posted by Otis Gospodnetic <ot...@gmail.com>.
Moreover, you may want to use fq=CreatedBy:user1 for filtering.
Otis
--
Solr & ElasticSearch Support -- http://sematext.com/
Performance Monitoring -- http://sematext.com/spm
On Tue, Jul 23, 2013 at 9:28 AM, Raymond Wiker <rw...@gmail.com> wrote:
> Simple: the field needs to be "indexed" in order to search (or filter) on
> it.
>
>
> On Tue, Jul 23, 2013 at 3:26 PM, Mysurf Mail <st...@gmail.com> wrote:
>
>> I want to restrict the returned results to be only the documents that were
>> created by the user.
>> I then load to the index the createdBy attribute and set it to index
>> false,stored="true"
>>
>> <field name="CreatedBy" type="string" indexed="false" stored="true"
>> required="true"/>
>>
>> then in the I want to filter by "CreatedBy" so I use the dashboard, check
>> edismax and add
>> I check edismax and add CreatedBy:user1 to the qf field.
>>
>>
>> the result query is
>>
>> http://
>> ....:8983/solr/vault/select?q=*%3A*&defType=edismax&qf=CreatedBy%3Auser1
>>
>> Nothing is filtered. all rows returned.
>> What was I doing wrong?
>>
Re: filter query result by user
Posted by Otis Gospodnetic <ot...@gmail.com>.
Hi,
Use fq, not qf. It needs to be indexed. Filtering is like searching
without scoring.
Otis
--
Solr & ElasticSearch Support -- http://sematext.com/
Performance Monitoring -- http://sematext.com/spm
On Tue, Jul 23, 2013 at 9:39 AM, Mysurf Mail <st...@gmail.com> wrote:
> I am probably using it wrong.
> http://
> ...:8983/solr/vault10k/select?q=*%3A*&defType=edismax&qf=CreatedBy%BLABLA
> returns all rows.
> It neglects my qf filter.
>
> Should I even use qf for filtrering with edismax?
> (It doesnt say that in the doc
> http://wiki.apache.org/solr/ExtendedDisMax#qf_.28Query_Fields.29)
>
>
>
> On Tue, Jul 23, 2013 at 4:32 PM, Mysurf Mail <st...@gmail.com> wrote:
>
>> But I dont want it to be searched.on
>>
>> lets say the user name is "giraffe"
>> I do want to filter to be "where created by = giraffe"
>>
>> but when the user searches his name, I will want only documents with name
>> "Giraffe".
>> since it is indexed, wouldn't it return all rows created by him?
>> Thanks.
>>
>>
>>
>> On Tue, Jul 23, 2013 at 4:28 PM, Raymond Wiker <rw...@gmail.com> wrote:
>>
>>> Simple: the field needs to be "indexed" in order to search (or filter) on
>>> it.
>>>
>>>
>>> On Tue, Jul 23, 2013 at 3:26 PM, Mysurf Mail <st...@gmail.com>
>>> wrote:
>>>
>>> > I want to restrict the returned results to be only the documents that
>>> were
>>> > created by the user.
>>> > I then load to the index the createdBy attribute and set it to index
>>> > false,stored="true"
>>> >
>>> > <field name="CreatedBy" type="string" indexed="false" stored="true"
>>> > required="true"/>
>>> >
>>> > then in the I want to filter by "CreatedBy" so I use the dashboard,
>>> check
>>> > edismax and add
>>> > I check edismax and add CreatedBy:user1 to the qf field.
>>> >
>>> >
>>> > the result query is
>>> >
>>> > http://
>>> > ....:8983/solr/vault/select?q=*%3A*&defType=edismax&qf=CreatedBy%3Auser1
>>> >
>>> > Nothing is filtered. all rows returned.
>>> > What was I doing wrong?
>>> >
>>>
>>
>>
Re: filter query result by user
Posted by Jack Krupansky <ja...@basetechnology.com>.
There is no such thing as a "qf filter" - "qf" is simply a list of names of
fields to search for the terms from the query, "q", as well as boost
factors. Filtering is done with "filter queries" - "fq".
-- Jack Krupansky
-----Original Message-----
From: Mysurf Mail
Sent: Tuesday, July 23, 2013 9:39 AM
To: solr-user@lucene.apache.org
Subject: Re: filter query result by user
I am probably using it wrong.
http://
...:8983/solr/vault10k/select?q=*%3A*&defType=edismax&qf=CreatedBy%BLABLA
returns all rows.
It neglects my qf filter.
Should I even use qf for filtrering with edismax?
(It doesnt say that in the doc
http://wiki.apache.org/solr/ExtendedDisMax#qf_.28Query_Fields.29)
On Tue, Jul 23, 2013 at 4:32 PM, Mysurf Mail <st...@gmail.com> wrote:
> But I dont want it to be searched.on
>
> lets say the user name is "giraffe"
> I do want to filter to be "where created by = giraffe"
>
> but when the user searches his name, I will want only documents with name
> "Giraffe".
> since it is indexed, wouldn't it return all rows created by him?
> Thanks.
>
>
>
> On Tue, Jul 23, 2013 at 4:28 PM, Raymond Wiker <rw...@gmail.com> wrote:
>
>> Simple: the field needs to be "indexed" in order to search (or filter) on
>> it.
>>
>>
>> On Tue, Jul 23, 2013 at 3:26 PM, Mysurf Mail <st...@gmail.com>
>> wrote:
>>
>> > I want to restrict the returned results to be only the documents that
>> were
>> > created by the user.
>> > I then load to the index the createdBy attribute and set it to index
>> > false,stored="true"
>> >
>> > <field name="CreatedBy" type="string" indexed="false" stored="true"
>> > required="true"/>
>> >
>> > then in the I want to filter by "CreatedBy" so I use the dashboard,
>> check
>> > edismax and add
>> > I check edismax and add CreatedBy:user1 to the qf field.
>> >
>> >
>> > the result query is
>> >
>> > http://
>> > ....:8983/solr/vault/select?q=*%3A*&defType=edismax&qf=CreatedBy%3Auser1
>> >
>> > Nothing is filtered. all rows returned.
>> > What was I doing wrong?
>> >
>>
>
>
Re: filter query result by user
Posted by Mysurf Mail <st...@gmail.com>.
I am probably using it wrong.
http://
...:8983/solr/vault10k/select?q=*%3A*&defType=edismax&qf=CreatedBy%BLABLA
returns all rows.
It neglects my qf filter.
Should I even use qf for filtrering with edismax?
(It doesnt say that in the doc
http://wiki.apache.org/solr/ExtendedDisMax#qf_.28Query_Fields.29)
On Tue, Jul 23, 2013 at 4:32 PM, Mysurf Mail <st...@gmail.com> wrote:
> But I dont want it to be searched.on
>
> lets say the user name is "giraffe"
> I do want to filter to be "where created by = giraffe"
>
> but when the user searches his name, I will want only documents with name
> "Giraffe".
> since it is indexed, wouldn't it return all rows created by him?
> Thanks.
>
>
>
> On Tue, Jul 23, 2013 at 4:28 PM, Raymond Wiker <rw...@gmail.com> wrote:
>
>> Simple: the field needs to be "indexed" in order to search (or filter) on
>> it.
>>
>>
>> On Tue, Jul 23, 2013 at 3:26 PM, Mysurf Mail <st...@gmail.com>
>> wrote:
>>
>> > I want to restrict the returned results to be only the documents that
>> were
>> > created by the user.
>> > I then load to the index the createdBy attribute and set it to index
>> > false,stored="true"
>> >
>> > <field name="CreatedBy" type="string" indexed="false" stored="true"
>> > required="true"/>
>> >
>> > then in the I want to filter by "CreatedBy" so I use the dashboard,
>> check
>> > edismax and add
>> > I check edismax and add CreatedBy:user1 to the qf field.
>> >
>> >
>> > the result query is
>> >
>> > http://
>> > ....:8983/solr/vault/select?q=*%3A*&defType=edismax&qf=CreatedBy%3Auser1
>> >
>> > Nothing is filtered. all rows returned.
>> > What was I doing wrong?
>> >
>>
>
>
Re: filter query result by user
Posted by Mysurf Mail <st...@gmail.com>.
But I dont want it to be searched.on
lets say the user name is "giraffe"
I do want to filter to be "where created by = giraffe"
but when the user searches his name, I will want only documents with name
"Giraffe".
since it is indexed, wouldn't it return all rows created by him?
Thanks.
On Tue, Jul 23, 2013 at 4:28 PM, Raymond Wiker <rw...@gmail.com> wrote:
> Simple: the field needs to be "indexed" in order to search (or filter) on
> it.
>
>
> On Tue, Jul 23, 2013 at 3:26 PM, Mysurf Mail <st...@gmail.com>
> wrote:
>
> > I want to restrict the returned results to be only the documents that
> were
> > created by the user.
> > I then load to the index the createdBy attribute and set it to index
> > false,stored="true"
> >
> > <field name="CreatedBy" type="string" indexed="false" stored="true"
> > required="true"/>
> >
> > then in the I want to filter by "CreatedBy" so I use the dashboard, check
> > edismax and add
> > I check edismax and add CreatedBy:user1 to the qf field.
> >
> >
> > the result query is
> >
> > http://
> > ....:8983/solr/vault/select?q=*%3A*&defType=edismax&qf=CreatedBy%3Auser1
> >
> > Nothing is filtered. all rows returned.
> > What was I doing wrong?
> >
>
Re: filter query result by user
Posted by Raymond Wiker <rw...@gmail.com>.
Simple: the field needs to be "indexed" in order to search (or filter) on
it.
On Tue, Jul 23, 2013 at 3:26 PM, Mysurf Mail <st...@gmail.com> wrote:
> I want to restrict the returned results to be only the documents that were
> created by the user.
> I then load to the index the createdBy attribute and set it to index
> false,stored="true"
>
> <field name="CreatedBy" type="string" indexed="false" stored="true"
> required="true"/>
>
> then in the I want to filter by "CreatedBy" so I use the dashboard, check
> edismax and add
> I check edismax and add CreatedBy:user1 to the qf field.
>
>
> the result query is
>
> http://
> ....:8983/solr/vault/select?q=*%3A*&defType=edismax&qf=CreatedBy%3Auser1
>
> Nothing is filtered. all rows returned.
> What was I doing wrong?
>