lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: multivalue or denormalise
Date Mon, 25 Jul 2011 19:52:57 GMT
I'm a little confused. Are you searching against these
different titles or is the search something else and you're really
only interested in displaying different titles for documents returned
for the query?

If it's just a display issue, you can use multivalued fields, the order
in which you put values in the fields is the order in which they're
returned and your application layer can decide whether to display
the title or not. This implies that you return all the titles and dates with
each document to the app...

If you're searching against titles and dates, that's a different case, you'd
be adding some clause like
AND ((title_1:yourtitle AND st_date_1:[* TO NOW] AND end_date_1:[NOW
TO *]) OR (same for title2) OR ....)

Best
Erick

On Mon, Jul 25, 2011 at 12:27 PM, abhayd <ajdabholkar@hotmail.com> wrote:
> hi
>
>
> What i want to do is get title_1 if NOW is between st_date_1 and end_date_1
> Also at the same time   get title_2 if NOW is between st_date_2 and
> end_date_2
>
> and so on
>
> at present i have a schema like this denorm'.   I cant figure it out a
> single solr query to  do this.
>   <field name="id" type="string" indexed="true" stored="true"
> omitNorms="true"/>
>   <field name="search_terms" type="text" indexed="true" stored="true"
> omitNorms="true" multiValued="true"/>
>   <field name="img_url" type="text" indexed="false" stored="true" />
>   <field name="number_of_links" type="sint" indexed="false" stored="true"
> />
>   <field name="header" type="text" indexed="false" stored="true" />
>   <field name="img_position" type="text" indexed="false" stored="true" />
>   <field name="url_1" type="text" indexed="false" stored="true"/>
>   <field name="title_1" type="text" indexed="false" stored="true"/>
>   <field name="desc_1" type="text" indexed="false" stored="true"/>
>   <field name="st_date_1" type="date" indexed="true" stored="true"/>
>   <field name="end_date_1" type="date" indexed="true" stored="true"/>
>   <field name="url_2" type="text" indexed="false" stored="true"/>
>   <field name="title_2" type="text" indexed="false" stored="true"/>
>   <field name="desc_2" type="text" indexed="false" stored="true"/>
>   <field name="st_date_2" type="date" indexed="true" stored="true"/>
>   <field name="end_date_2" type="date" indexed="true" stored="true"/>
>   <field name="url_3" type="text" indexed="false" stored="true"/>
>   <field name="title_3" type="text" indexed="false" stored="true"/>
>   <field name="desc_3" type="text" indexed="false" stored="true"/>
>   <field name="st_date_3" type="date" indexed="true" stored="true"/>
>   <field name="end_date_3" type="date" indexed="true" stored="true"/>
>   <field name="url_4" type="text" indexed="false" stored="true"/>
>   <field name="title_4" type="text" indexed="false" stored="true"/>
>   <field name="desc_4" type="text" indexed="false" stored="true"/>
>   <field name="st_date_4" type="date" indexed="true" stored="true"/>
>   <field name="end_date_4" type="date" indexed="true" stored="true"/>
>
> Any help getting correct query?
>
> Also i thought of using multivalue filed like
> title , st_date, end_date, But I am not sure if two multivalue fields
> co-relate with each other. That is if today's date does not fall in first
> st_date and first end_date then i dont want to have first title in results.
> Is that possible ?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/multivalue-or-denormalise-tp3197942p3197942.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Mime
View raw message