Hi Erik,

I completely agree with you that showing a random document for user's query
would be very poor experience. I have raised this in our product review
meetings before. I was told that because of contractual agreement some
sponsored content needs to be returned even if it meant no match. And the
sponsored content drives the ads displayed on the page-- so it is more for
showing some ad on the page when there is no matching result from sponsored
content for user's query.

Note that some other content in addition to sponsored content is displayed
on the page, so user is not seeing just one random result when there is not
a good match.

It looks like I have to do another search to get a random result when there
are no results. In this case I will use RandomSortField to generate random
result (so that a different ad is displayed from set of sponsored ads) for
each no result case.

Thanks for the comments!


Satish



On Sun, Sep 12, 2010 at 10:25 AM, Erick Erickson <erickerick...@gmail.com>wrote:

> Could you explain the use-case a bit? Because the very
> first response I would have is "why in the world did
> product management make this a requirement" and try
> to get the requirement changed....
>
> As a user, I'm having a hard time imagining being well
> served by getting a document in response to a search that
> had no relation to my search, it was just a random doc
> selected from the corpus.
>
> All that said, I don't think a single query would do the trick.
> You could include a "very special" document with a field
> that no other document had with very special text in it. Say
> field name "bogusmatch", filled with the text "bogustext"
> then, at least the second query would match one and only
> one document and would take minimal time. Or you could
> tack on to each and every query "OR bogusmatch:bogustext^0.0000001"
> (which would really be inexpensive) and filter it out if there
> was more than one response. By boosting it really low, it should
> always appear at the end of the list which wouldn't be a bad thing.
>
> DisMax might help you here...
>
> But do ask if it is really a requirement or just something nobody's
> objected to before bothering IMO...
>
> Best
> Erick
>
> On Sat, Sep 11, 2010 at 1:10 PM, Satish Kumar <
> satish.kumar.just.d...@gmail.com> wrote:
>
> > Hi,
> >
> > We have a requirement to show at least one result every time -- i.e.,
> even
> > if user entered term is not found in any of the documents. I was hoping
> > setting mm to 0 will return results in all cases, but it is not.
> >
> > For example, if user entered term "alpha" and it is *not* in any of the
> > documents in the index, any document in the index can be returned. If
> term
> > "alpha" is in the document set, documents having the term "alpha" only
> must
> > be returned.
> >
> > My idea so far is to perform a search using user entered term. If there
> are
> > any results, return them. If there are no results, perform another search
> > without the query term-- this means doing two searches. Any suggestions
> on
> > implementing this requirement using only one search?
> >
> >
> > Thanks,
> > Satish
> >
>

Reply via email to