Hi,

SIREn [1], a Lucene/Solr plugin, allows you perform queries across an undetermined number of fields, even if you have hundred of thousands of fields. It might be helpful for your scenario.

[1] http://siren.sindice.com
--
Renaud Delbru

On 07/04/11 19:18, jisenhart wrote:

I have a question on how to set up queries not having a predetermined
field list to search on.

Here are some sample docs,
<doc>
<str name="_id">1234</str>
<str name="_fred"><str>hi</str><str>hello</str></str>
<str name="_group3"><str>lala</str><str>chika chika boom boom</str></str>
</doc>
<doc>
<str name="_id">1235</str>
<str name="_group1"><str>foo</str><str>bar</str><str>happy happy joy
joy</str></str>
<str name="_group2"><str>some text</str><str>some more words to
search</str></str>
</doc>
.
.
.
<doc>
<str name="_id">4567</str>
<str name="_wilma"><str>bed</str><str>rock</str></str>
<str name="_group3"><str>meme</str><str>you you</str></str>
<str name="_group52"><str>super duper</str><str>are we done?</str></str>
</doc>

Now a given user user, say fred, belongs to any number of groups, say
only fred, and group1 for this example.
A query on 'foo' is easy if I know that fred belongs to only these two:

_fred:foo OR _group1:foo //will find a hit on doc 1235

However, a user can belong to any number of groups. How do I perform
such a search if the users group list is arbitrarily large?

Could I somehow make use of reference docs like so:

<doc>
<str name="_id">fred</str>
<str name="_groups"><str>fred</str><str>group1</str></str>
</doc>
.
.
.
<doc>
<str name="_id">wilma</str>
<str
name="_groups"><str>wilma</str><str>group1</str><str>group5</str><str>group9</str><str>group11</str><str>group31</str><str>group40</str></str>

</doc>


Reply via email to