There is a builtin fieldType to support random results.

    <!-- The "RandomSortField" is not used to store or search any
         data.  You can declare fields of this type it in your schema
         to generate psuedo-random orderings of your docs for sorting
         purposes.  The ordering is generated based on the field name
         and the version of the index, As long as the index version
         remains unchanged, and the same field name is reused,
         the ordering of the docs will be consistent.
         If you want differend psuedo-random orderings of documents,
         for the same version of the index, use a dynamicField and
         change the name
     -->
    <fieldType name="random" class="solr.RandomSortField" indexed="true" />

Every time you want a different random ordering, query a dynamic field
type and change the name (increase a counter, or simply include a
random number in the name).

-Yonik

On Tue, Mar 4, 2008 at 11:49 AM, Evgeniy Strokin
<[EMAIL PROTECTED]> wrote:
> I want to get sample from my search result. Not first 10 but 10 random 
> (really random, not pseudo random) documents.
>  For example if I run simple query like STATE:NJ no order by any field, just 
> the query and get 10 first documents from my result set, will it be random 10 
> or pseudo random, like first 10 indexed or something like this?
>
>  Thank you
>  Gene

Reply via email to