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 Paul Rosen <pa...@performantsoftware.com> on 2009/10/02 22:27:11 UTC

Specifying "all except field" in field list?

Hi,

Is there a way to request all fields in an object EXCEPT a particular 
one? In other words, the following pseudo code is what I'd like to express:

req = Solr::Request::Standard.new(:start => page*size, :rows => size,
:query => my_query, :field_list => [ ALL EXCEPT 'text' ])

Is there a way to say that?

I know I could figure out all possible fields and make an array of them, 
but that list is likely to change over time and I'm sure to forget to 
update it.

I need to do that because the text field is not needed and is likely to 
be really large so the queries will be much faster if it isn't returned.

Thanks,
Paul

Re: Specifying "all except field" in field list?

Posted by Lance Norskog <go...@gmail.com>.
Maybe the TermsComponent?

You can't ask for facets with a wildcard in the field name. This would
do the trick. It's an issue in JIRA, if you want to vote for it.

http://issues.apache.org/jira/browse/SOLR-247
http://issues.apache.org/jira/browse/SOLR-1387

On Fri, Oct 2, 2009 at 6:36 PM, Paul Rosen <pa...@performantsoftware.com> wrote:
> Thanks, Lance, for the quick reply.
>
> Well, unfortunately, we need the highlighting feature on that field, so I
> think we have to store it.
>
> It's not a big deal, it just seemed like something that would be useful and
> probably be easy to implement, so I figured I just missed it.
>
> Alternately, is there a way, through solr, to get a list of all the fields
> that any object could possibly return? I suppose I could just read the
> schema.xml file and read all the <field> tags, but I'd miss the fields
> created by <dynamicField>. I'm hoping I can query the index to get that
> info.
>
> Lance Norskog wrote:
>>
>> No, there is only "list of fields", star, and score.  You can choose
>> to index it and not store it, and then have your application fetch it
>> from the original data store. This is a common system design pattern
>> to avoid storing giant text blobs in the index.
>>
>> http://wiki.apache.org/solr/FieldAliasesAndGlobsInParams
>>
>> On Fri, Oct 2, 2009 at 1:27 PM, Paul Rosen <pa...@performantsoftware.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> Is there a way to request all fields in an object EXCEPT a particular
>>> one?
>>> In other words, the following pseudo code is what I'd like to express:
>>>
>>> req = Solr::Request::Standard.new(:start => page*size, :rows => size,
>>> :query => my_query, :field_list => [ ALL EXCEPT 'text' ])
>>>
>>> Is there a way to say that?
>>>
>>> I know I could figure out all possible fields and make an array of them,
>>> but
>>> that list is likely to change over time and I'm sure to forget to update
>>> it.
>>>
>>> I need to do that because the text field is not needed and is likely to
>>> be
>>> really large so the queries will be much faster if it isn't returned.
>>>
>>> Thanks,
>>> Paul
>>>
>>
>>
>>
>
>



-- 
Lance Norskog
goksron@gmail.com

Re: Specifying "all except field" in field list?

Posted by Paul Rosen <pa...@performantsoftware.com>.
Thanks, Lance, for the quick reply.

Well, unfortunately, we need the highlighting feature on that field, so 
I think we have to store it.

It's not a big deal, it just seemed like something that would be useful 
and probably be easy to implement, so I figured I just missed it.

Alternately, is there a way, through solr, to get a list of all the 
fields that any object could possibly return? I suppose I could just 
read the schema.xml file and read all the <field> tags, but I'd miss the 
fields created by <dynamicField>. I'm hoping I can query the index to 
get that info.

Lance Norskog wrote:
> No, there is only "list of fields", star, and score.  You can choose
> to index it and not store it, and then have your application fetch it
> from the original data store. This is a common system design pattern
> to avoid storing giant text blobs in the index.
> 
> http://wiki.apache.org/solr/FieldAliasesAndGlobsInParams
> 
> On Fri, Oct 2, 2009 at 1:27 PM, Paul Rosen <pa...@performantsoftware.com> wrote:
>> Hi,
>>
>> Is there a way to request all fields in an object EXCEPT a particular one?
>> In other words, the following pseudo code is what I'd like to express:
>>
>> req = Solr::Request::Standard.new(:start => page*size, :rows => size,
>> :query => my_query, :field_list => [ ALL EXCEPT 'text' ])
>>
>> Is there a way to say that?
>>
>> I know I could figure out all possible fields and make an array of them, but
>> that list is likely to change over time and I'm sure to forget to update it.
>>
>> I need to do that because the text field is not needed and is likely to be
>> really large so the queries will be much faster if it isn't returned.
>>
>> Thanks,
>> Paul
>>
> 
> 
> 


Re: Specifying "all except field" in field list?

Posted by Lance Norskog <go...@gmail.com>.
No, there is only "list of fields", star, and score.  You can choose
to index it and not store it, and then have your application fetch it
from the original data store. This is a common system design pattern
to avoid storing giant text blobs in the index.

http://wiki.apache.org/solr/FieldAliasesAndGlobsInParams

On Fri, Oct 2, 2009 at 1:27 PM, Paul Rosen <pa...@performantsoftware.com> wrote:
> Hi,
>
> Is there a way to request all fields in an object EXCEPT a particular one?
> In other words, the following pseudo code is what I'd like to express:
>
> req = Solr::Request::Standard.new(:start => page*size, :rows => size,
> :query => my_query, :field_list => [ ALL EXCEPT 'text' ])
>
> Is there a way to say that?
>
> I know I could figure out all possible fields and make an array of them, but
> that list is likely to change over time and I'm sure to forget to update it.
>
> I need to do that because the text field is not needed and is likely to be
> really large so the queries will be much faster if it isn't returned.
>
> Thanks,
> Paul
>



-- 
Lance Norskog
goksron@gmail.com