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 Brian Carmalt <bc...@contact.de> on 2007/10/15 15:32:01 UTC

Searching dynamic fields

Hello all,

Is there a way to search dynamicFields, without having to specify the 
name of the
filed in a Query.
Example: I have index a doc with the field name myDoc_text_en. and I 
have a dynamic field
*_text_en which maps to a type of text_en. How can I search this field 
without knowing its
specific name?  Can I search according to field type? I have looked at the
DisMaxRequestHandler, which might work, but it doesn't accept wildcard 
field names or field types.

I'm using 1.3.
Thanks in advance.

Brian


Re: Searching dynamic fields

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Oct 15, 2007, at 11:18 AM, Brian Carmalt wrote:
> A field copy implies a doubling of the data in the Index, right? OR  
> should I not store or index the
> dynamic field and instead copy it to another field, and then let it  
> be indexed and stored?

For a purely searchable field like an aggregation of *_en like we're  
talking about, you don't need that stored so you it won't quite be a  
doubling.  It might only be a small increase in index size, actually.

> Another possibility would be to search all fields, but that doesn't  
> seem to be possible. Or am I Missing something?

No, that is not possible without explicitly listing the fields in a  
dismax request handler.

One thing you can do, though, is request the fields from Solr and  
then use that to dynamically build your request.  The  
LukeRequestHandler will give you the list of fields in the index, and  
the client could use those fields to construct the query.

	Erik


Re: Searching dynamic fields

Posted by Brian Carmalt <bc...@contact.de>.
Hello Erik,

A field copy implies a doubling of the data in the Index, right? OR 
should I not store or index the
dynamic field and instead copy it to another field, and then let it be 
indexed and stored?

Another possibility would be to search all fields, but that doesn't seem 
to be possible. Or am I Missing something?

Thanks, Brian.

Erik Hatcher schrieb:
> Brian - you can copyField all *_en fields to a common "contents_en" 
> field, for example, and then search contents_en:(for whatever).
>
> You cannot currently search by field type, though that is an 
> interesting possible feature.
>
> I would like to see Solr support wildcarded field names in request 
> parameters, but we're not there yet.
>
>     Erik
>
>
> On Oct 15, 2007, at 9:32 AM, Brian Carmalt wrote:
>
>> Hello all,
>>
>> Is there a way to search dynamicFields, without having to specify the 
>> name of the
>> filed in a Query.
>> Example: I have index a doc with the field name myDoc_text_en. and I 
>> have a dynamic field
>> *_text_en which maps to a type of text_en. How can I search this 
>> field without knowing its
>> specific name?  Can I search according to field type? I have looked 
>> at the
>> DisMaxRequestHandler, which might work, but it doesn't accept 
>> wildcard field names or field types.
>>
>> I'm using 1.3.
>> Thanks in advance.
>>
>> Brian
>
>


Re: Searching dynamic fields

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Brian - you can copyField all *_en fields to a common "contents_en"  
field, for example, and then search contents_en:(for whatever).

You cannot currently search by field type, though that is an  
interesting possible feature.

I would like to see Solr support wildcarded field names in request  
parameters, but we're not there yet.

	Erik


On Oct 15, 2007, at 9:32 AM, Brian Carmalt wrote:

> Hello all,
>
> Is there a way to search dynamicFields, without having to specify  
> the name of the
> filed in a Query.
> Example: I have index a doc with the field name myDoc_text_en. and  
> I have a dynamic field
> *_text_en which maps to a type of text_en. How can I search this  
> field without knowing its
> specific name?  Can I search according to field type? I have looked  
> at the
> DisMaxRequestHandler, which might work, but it doesn't accept  
> wildcard field names or field types.
>
> I'm using 1.3.
> Thanks in advance.
>
> Brian