[V4MD] Relevance of search results

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Nov 16 00:18:34 CST 2003


on 11/15/03 11:50 PM, Scott Runkel at srunkel at hypix.com wrote:

Hi Scott,

> This is probably a really stupid question, but you never know...
> 
> Is there any way to order the seach results by relevance? For example, if I'm
> searching 1000 records for a certain word, it would be nice to order the
> results
> based on how many times that word appears in each record.
> 
> I can do this in Director/Lingo as a secondary step using another Xtra called
> TextCruncher, but this involves having to fiddle with the Valentina Cursor and
> creating my own ordering of the Cursor results. Which probably isn't that bad,
> but if there's any other way it would be good to know.

Valentina cannot count how many times some word is repeated in the same
field value... 

Interesting.

I think this can be implemented as one more function

    count_word( fld, 'word' )

Return the number of times 'word' found in the current record of fld.

Then we can make such BaseObject and do

    select fld, counter
    from T
    WHERE fld LIKE 'word'
    ORDER BY counter

Or in 2.0 without BaseObject method at all

    select fld, count_word( fld, 'word' )
    from T
    WHERE fld LIKE 'word'
    ORDER BY 2


Ivan, Igor, agree?
Let's add such function into 2.0

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list