On Sun, May 26, 2013, at 10:41 PM, Oleksiy Druzhynin wrote:
> I have document divider by paragraphs. How better to add it to Solr?
> As single str field:
> 
> <field name="main">
>   paragraph1
>   paragraph2
>   paragraph3
> </field>
> 
>  Or multivalued fields:
>  <field name=" paragraph "> paragraph1 </field>
>  <field name=" paragraph "> paragraph2 </field>
>  <field name=" paragraph "> paragraph3 </field>

Depends what you want!

Leaving aside what you want back in terms of stored fields, it won't
make a huge amount of difference - the words will still be indexed.

The main difference I can think of is to do with positionIncrementGap,
which is used to influence term positions, which is relevant for phrase
queries. Take the following sentences:

I like Summer.
Sun warms the earth.

As a single field, "summer sun" would match as a phrase query. As a
multivalued field with a positionIncrementGap of zero, I'm pretty sure
"summer sun" would also match. However, with a gap of 100 for a
multivalued field, "summer" and "sun" would be considered 101 positions
apart - as such they're not next to each other and therefore wouldn't
constitute a phrase.

Upayavira

Reply via email to