django-haystack icon indicating copy to clipboard operation
django-haystack copied to clipboard

support for random order in Solr engine

Open fsw opened this issue 12 years ago • 5 comments

followup of #834

adds support for random order when passing '?' as order_by parameter.

http://lucene.apache.org/solr/4_3_1/solr-core/org/apache/solr/schema/RandomSortField.html

fsw avatar Jul 22 '13 16:07 fsw

:thumbsup: on this feature. Do you think it would make sense to add some discussion to the documentation – probably https://django-haystack.readthedocs.org/en/latest/installing_search_engines.html#solr – which links to the Solr RandomSortField information and describes the schema update? The order_by() docs could link to the backend support details, too.

acdha avatar Jul 22 '13 18:07 acdha

Thanks, But I am not sure what to put there and how it would help. Changes in haystack/templates/search_configuration/solr.xml are int the 'static part'. As far as i can see, other field types and other dynamic fields in solr config are not documented anyhow in haystack docs.

Only note to users i can think of is that if they upgraded haystack, to use this feature they need to run build_solr_schema again (and optionally update their custom template). But guess this is self implied?

For new users first note here https://django-haystack.readthedocs.org/en/latest/installing_search_engines.html#solr covers it up i think.

fsw avatar Jul 22 '13 18:07 fsw

Also in case anyone would be interested here are some ideas on how to implement this feature in Elastic search:

http://stackoverflow.com/questions/9796470/random-order-pagination-elasticsearch

fsw avatar Jul 22 '13 18:07 fsw

@fsw I was thinking it should follow the pattern of MLT and spelling suggestions where the documentation specifies configuration required for non-core features.

acdha avatar Jul 22 '13 19:07 acdha

@acdha MLT and spelling suggestions require user to change his solrconfig.xml whereas random order does not require anything so not sure what to put there but indeed this makes kinda sense. Added some info and cross-linked.

fsw avatar Jul 23 '13 10:07 fsw