solr - Dealing with many calendars and good way to store / query them -


some model first : have ad contain calendar. each date has boolean (more ternary valued field, not change problem) check disponibility of ad on date (yes, no, unknown). want make solr index able search ad document (that part done) , add faceting or querying on disponibility.

ie: ad matching ... plus disponible between , b. solr return me list of ad document has calendar disponible (or unknown...) on date.

how can describe solr index able search ads such constraints, if posible?

any appreciated , time. sorry bad english , grammar review nice!

achieving search output in desired form first requires proper schema structure. based on description, have 3 fields: "ad", "date" , "disponibility". however, want "date" , "disponibility" associated each other. structuring index separate fields isn't desirable.

in case, consider following schema:

<fields>   <field name="ad" type="string" indexed="true" stored="true" required="true" />   <field name="disp-yes" type="date" indexed="true" stored="true" required="true" multivalued="true"/>   <field name="disp-no" type="date" indexed="true" stored="true" required="true" multivalued="true"/>   <field name="disp-unknown" type="date" indexed="true" stored="true" required="true" multivalued="true"/> </fields> 

(guesses made indexed, stored , datatype attributes.)

in schema, can index each ad , add date values "disp-*" field definitions. when querying, can structure searches retrieve ads based on disponibility applying facet queries.

an added benefit of structuring disp-* fields date types range query support, applies both search results facets.


Comments