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 Ian Smith <Ia...@gossinteractive.com> on 2009/12/09 10:39:40 UTC

Selection of returned fields - dynamic fields?

Hi Guys,

We need to eliminate one of our stored fields from the Solr response to
reduce traffic as it is very bulky and not used externally.  I have been
experimenting both with "fl=FIELDNAME" and addField(FIELDNAME) from
SolrJ and have found it is possible to achieve this effect for fixed
fields by starting with an empty list and adding the field names
explicitly in the request.

Unfortunately this does not seem to work for dynamic fields -
"fl=PREFIX*" does not return anything, and neither does "fl=*POSTFIX".
What seems to be missing from Solr is a removeField(FIELDNAME) method in
SolrJ, or a "fl=-FIELDNAME" query parameter to remove the fixed field.

Is such a feature planned, or is there a workaround that I have missed?

Regards,

Ian.

RE: Selection of returned fields - dynamic fields?

Posted by Ian Smith <Ia...@gossinteractive.com>.
OK thanks for the reply, fortunately we have now found an approach which
avoids storing the field.  It would be nice to be able to search for
dynamic fields in a way which is consistent with their definition,
although I suppose there probably isn't demand for this.

Regards,

Ian.

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: 09 December 2009 19:36
To: solr-user@lucene.apache.org
Cc: Gary Ratcliffe
Subject: Re: Selection of returned fields - dynamic fields?


: Unfortunately this does not seem to work for dynamic fields -

you can definiltely ask for a field that exists because of a
dynamicField by name, but you can't use wildcard style patterns in the
"fl" param.

: "fl=PREFIX*" does not return anything, and neither does "fl=*POSTFIX".
: What seems to be missing from Solr is a removeField(FIELDNAME) method
in
: SolrJ, or a "fl=-FIELDNAME" query parameter to remove the fixed field.
: 
: Is such a feature planned, or is there a workaround that I have
missed?

There's been a lot of discussion about it over the years, the crux of
the problem is that it's hard to come up with a good way of dealing with
field names using "meta characters" that doesn't make it hard for people
to actaully use those metacharacters in their field names...

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

-Hoss


Re: Selection of returned fields - dynamic fields?

Posted by Chris Hostetter <ho...@fucit.org>.
: Unfortunately this does not seem to work for dynamic fields -

you can definiltely ask for a field that exists because of a dynamicField 
by name, but you can't use wildcard style patterns in the "fl" param.

: "fl=PREFIX*" does not return anything, and neither does "fl=*POSTFIX".
: What seems to be missing from Solr is a removeField(FIELDNAME) method in
: SolrJ, or a "fl=-FIELDNAME" query parameter to remove the fixed field.
: 
: Is such a feature planned, or is there a workaround that I have missed?

There's been a lot of discussion about it over the years, the crux of the 
problem is that it's hard to come up with a good way of dealing with 
field names using "meta characters" that doesn't make it hard for people 
to actaully use those metacharacters in their field names...

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

-Hoss