FAQ
In following the LIA custom sort example, the calculated sort value is based
on a field that contains all necessary values, i.e. "x,y" which is split
into two values for use in a distance algorithm.

Suppose I want a custom sort basis that performs a similar calculation, but
is based on a multiple # (3,4,....n) of fields?

1. I assume I'm just not connecting the dots on the API, but how do I get
the terms from multiple fields in order to generate the calculation?
2. In spite of knowing the syntax, is this a perf killer? Is it better to
load all the values in one field, then split them out in a string[] similar
to the LIA example?

cheers,
jeff r.

Search Discussions

  • Yonik Seeley at Oct 10, 2005 at 5:41 pm
    You can use the FieldCache to access the values of multiple fields (the same
    source default sorting uses).

    Alternately, if you want to generate a score based on a function of multiple
    fields rather than doing an absolute sort, you can use FunctionQuery:
    http://issues.apache.org/jira/browse/LUCENE-446
    2. In spite of knowing the syntax, is this a perf killer? Is it better to
    load all the values in one field, then split them out in a string[] similar
    to the LIA example?
    Separate fields is more flexible (unless you never want to sort or query on
    them independently). The performance would depend somewhat on what function
    you are calculating.


    -Yonik
    Now hiring -- http://tinyurl.com/7m67g
    On 10/9/05, Jeff Rodenburg wrote:

    In following the LIA custom sort example, the calculated sort value is
    based
    on a field that contains all necessary values, i.e. "x,y" which is split
    into two values for use in a distance algorithm.

    Suppose I want a custom sort basis that performs a similar calculation,
    but
    is based on a multiple # (3,4,....n) of fields?

    1. I assume I'm just not connecting the dots on the API, but how do I get
    the terms from multiple fields in order to generate the calculation?
    2. In spite of knowing the syntax, is this a perf killer? Is it better to
    load all the values in one field, then split them out in a string[]
    similar
    to the LIA example?

    cheers,
    jeff r.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedOct 9, '05 at 4:14p
activeOct 10, '05 at 5:41p
posts2
users2
websitelucene.apache.org

2 users in discussion

Yonik Seeley: 1 post Jeff Rodenburg: 1 post

People

Translate

site design / logo © 2022 Grokbase