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 solruser <so...@gmail.com> on 2007/05/22 22:27:08 UTC

Query

Hi,

I have a question related to Index, where I have indexed my document with
mutiple replies enumerated fields in the document. e.g. 
 <document>
     <reply0> </reply0>
     <reply1> </reply1>
     ..
     ..
  </document>

now how can I query document so I can search a document on the content of
any reply. Can I make a query such as <<< reply*:content >>>

-thanks 

-- 
View this message in context: http://www.nabble.com/Query-tf3800255.html#a10751884
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Query

Posted by Yonik Seeley <yo...@apache.org>.
On 5/22/07, solruser <so...@gmail.com> wrote:
> I thought of using multi-valued field but since I am using reply ids to
> store as string and I have dynamic field in schema. I am not sure will
> multi-valued field will work in this scenario case.

Unless you need to ever query reply0 separately from reply1, it seems
like a single multi-valued reply field should work.

> Earlier I tried to another field in the document which contain newline
> character into single value field and I got an error about entering
> multi-valued data in single value field.

Newlines should be fine in single or multi-valued fields...newlines
aren't special to solr or lucene.
You could also store all of the lines of reply (or all replies) as a
single field.

-Yonik

Re: Query

Posted by solruser <so...@gmail.com>.
Hi Yonik,

Thanks for the reply. 

I thought of using multi-valued field but since I am using reply ids to
store as string and I have dynamic field in schema. I am not sure will
multi-valued field will work in this scenario case.  

Earlier I tried to another field in the document which contain newline
character into single value field and I got an error about entering
multi-valued data in single value field. So I updated the field with
multi-valued and it works but I thought that would be such scenarios. But
yes for my scenario single name will work perfect. I'll update and give it a
try. 

So this raises another question on how to store any newline character in the
content. Is it correct to store such information in multi-valued field or am
I doing something wrong that could effect search results. 

Another point regarding  multivalued fields with content (needed for
highlighting purposes) for reply which can run around 100 on the higher side
and considering if each reply can have some newline characters too will it
be safe to store under single multi-valued field.

Thanks 
- Amit





Yonik Seeley wrote:
> 
> On 5/22/07, solruser <so...@gmail.com> wrote:
>> I have a question related to Index, where I have indexed my document with
>> mutiple replies enumerated fields in the document. e.g.
>>  <document>
>>      <reply0> </reply0>
>>      <reply1> </reply1>
>>      ..
>>      ..
>>   </document>
>>
>> now how can I query document so I can search a document on the content of
>> any reply. Can I make a query such as <<< reply*:content >>>
> 
> No, you need to enumerate the fields to search.
> 
> Something like the dismax handler can help here by separating the
> query from the fields that should be searched.
> 
> Solr allows multi-valued fields too.  Do you need fields with a
> different name, or could a single reply field work?
>   <document>
>       <reply> </reply>
>       <reply> </reply>
>       ..
>       ..
>   </document>
> 
> -Yonik
> 
> 

-- 
View this message in context: http://www.nabble.com/Query-tf3800255.html#a10755312
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Query

Posted by Yonik Seeley <yo...@apache.org>.
On 5/22/07, solruser <so...@gmail.com> wrote:
> I have a question related to Index, where I have indexed my document with
> mutiple replies enumerated fields in the document. e.g.
>  <document>
>      <reply0> </reply0>
>      <reply1> </reply1>
>      ..
>      ..
>   </document>
>
> now how can I query document so I can search a document on the content of
> any reply. Can I make a query such as <<< reply*:content >>>

No, you need to enumerate the fields to search.

Something like the dismax handler can help here by separating the
query from the fields that should be searched.

Solr allows multi-valued fields too.  Do you need fields with a
different name, or could a single reply field work?
  <document>
      <reply> </reply>
      <reply> </reply>
      ..
      ..
  </document>

-Yonik