FAQ
Hi all, Is there a way to specify the default sort fields in the solr schema in 3.6 or 4.0Beta? similar to the default search operator. Like, the default search operator can be set to "OR" and only when you want to override you pass it in the search URL as "AND". I have lots of fields related to the docs I'm indexing and want the result to be sorted on certain set of fields by default. Would appreciate any help in this direction. Thanks in advance.
Regards, DK

Search Discussions

  • Michael Della Bitta at Oct 3, 2012 at 2:54 pm
    DK,

    <defaultSearchField>myFieldName</defaultSearchField> just inside the
    <schema/> tag in schema.xml still works, but is considered deprecated.
    Otherwise it's specified using a df param in the definition of your
    search handler in solrconfig.xml:
    http://wiki.apache.org/solr/SearchHandler#df


    Michael Della Bitta

    ------------------------------------------------
    Appinions
    18 East 41st Street, 2nd Floor
    New York, NY 10017-6271

    www.appinions.com

    Where Influence Isn’t a Game

    On Wed, Oct 3, 2012 at 10:49 AM, A Geek wrote:

    Hi all, Is there a way to specify the default sort fields in the solr schema in 3.6 or 4.0Beta? similar to the default search operator. Like, the default search operator can be set to "OR" and only when you want to override you pass it in the search URL as "AND". I have lots of fields related to the docs I'm indexing and want the result to be sorted on certain set of fields by default. Would appreciate any help in this direction. Thanks in advance.
    Regards, DK
  • Markus Jelsma at Oct 3, 2012 at 2:54 pm
    No, not in the schema but in the solrconfig. Look for your request handler such as the default:
    <requestHandler name="/select" class="solr.SearchHandler">

    you can add a default value for the sort parameter

    <str name="sort">field desc</str>


    -----Original message-----
    From:A Geek <dw.90@live.com>
    Sent: Wed 03-Oct-2012 16:53
    To: solr-user@lucene.apache.org
    Subject: how to specify default sort fields in solr schema?


    Hi all, Is there a way to specify the default sort fields in the solr schema in 3.6 or 4.0Beta? similar to the default search operator. Like, the default search operator can be set to "OR" and only when you want to override you pass it in the search URL as "AND". I have lots of fields related to the docs I'm indexing and want the result to be sorted on certain set of fields by default. Would appreciate any help in this direction. Thanks in advance.
    Regards, DK

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsolr-user @
categorieslucene
postedOct 3, '12 at 2:50p
activeOct 3, '12 at 2:54p
posts3
users3
websitelucene.apache.org...

People

Translate

site design / logo © 2022 Grokbase