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 Frederick Giasson <fr...@fgiasson.com> on 2009/10/22 19:59:40 UTC

Searching over all Dynamic Fields: different things tested, multiple issues experienced

Hi everybody,

I have a prototype Solr schema defining a couple of dynamic fields 
pattern. With my usage of Solr, new dynamic fields can be added at any time.

What I want to do is to be able to search over all fields of my schema 
(dynamic and not). Since the application layer doesn't know what fields 
exists (without querying it), I don't want to list all of them in the 
search query, and I don't want to list all of them in the dismax query 
handler.

However, the field "*" is not existing (wildcards are not supported as 
fields), so I can't send queries such as "q=*:testString".

So, apparently that one of the only way to do this considering my 
usecase above, is to create a field "all_text", and then to setup the 
appropriate copyFields so that each time a new dynamic field is created, 
then that its value get indexed in that "all_text" field. The I made 
this field the default search field.

This solution works, even if I don't like seeing all this content 
duplicated.

However, I don't want to get the content of that field in any resultset 
of any search query. I want it to be searchable, but I don't want it 
added in the resultset.

I can't use the FL parameter because I don't want to list all of them in 
the query to Solr, and apparently that we can't use FL to "ignore" a 
list of fields.

So, I took at look at the definition of my "all_text" field, and I found 
this table:

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

It suggests that if this field is "indexed=true" and "stored=false", 
that it would be searchable without being added to the resultset. 
However, this doesn't work.

When I test it, if I test it with "stored=true", it works as expected, 
if I test with with "stored=false" the resultset is empty.



So, given my needs, given my usecases and given these tests, does 
anybody know why "stored=false" doesn't work th way I thought it was 
working, or if there would be a way to ignore a field in a search 
resultset, or if there is another way to search over all dynamic fields 
without using this copyField "trick".

Finally I can't change the codebase, I have to use what is shipped by 
default by the Solr project.


Thanks for your help!


Take care,


Fred

Re: Searching over all Dynamic Fields: different things tested, multiple issues experienced

Posted by Chris Hostetter <ho...@fucit.org>.
: When I test it, if I test it with "stored=true", it works as expected, if I
: test with with "stored=false" the resultset is empty.

Adding stored="false" has no impact on anything related to searchings -- 
it only affects what values can be written out by the response writer. 
There's no way only changing that attribute on a field could produce the 
behavior you're describing.

If you post your schema.xml, some sample data, and examples of the queries 
you are attempting; people could probably help you spot what may be 
causing your problem.

-Hoss