On Fri, Mar 4, 2011 at 10:24 AM, Alex Dong <a...@trunk.ly> wrote:
> Hi there,  I need some advice on how to implement this using solr:
>
> We have two tables: urls and bookmarks.
> - Each url has four fields:  {guid, title, text, url}
> - One url will have one or more bookmarks associated with it. Each bookmark
> has these: {link.guid, user, tags, comment}
>
> I'd like to return matched urls based on not only the "title, text" from the
> url schema, but also some kind of aggregated popularity score based on all
> "bookmarks" for the same url. The popularity score should base on
> number/frequency of bookmarks that match the query.
[...]

It is best not to think of Solr as a RDBMS, and not to try to graft
RDBMS practices on to it. Instead, you should flatten your data,
e.g., in the above, you could have:
* Four single-valued fields: guid, title, text, url
* Four multi-valued fields: bookmark_guid, bookmark_user,
  bookmark_tags, bookmark_comment
Your index would contain one record per guid of the URL,
and you would need to populate the multi-valued bookmark
fields from all bookmark instances associated with that URL.

Then one could either copy the relevant search fields to a full-text
search field, and search only on that, or, e.g., search on bookmark_tags
and bookmark_comment in addition to searching on title, and text.

Regards,
Gora

Reply via email to