Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 822671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:49:58+00:00 2026-05-15T02:49:58+00:00

The title is a bit awkward but I couldn’t found a better one. My

  • 0

The title is a bit awkward but I couldn’t found a better one. My problem is as follows:

I have several users stored as documents and I am storing several key-value-pairs or items (which have an id) for each document. Now, if I apply highlighting with hl.snippets=5 I can get the first 5 items. But every user could have several hundreds items, so

  • you will not get the most relevant 5 items. You will get the first 5 items …

Another problem is that

  • the highlighted text won’t contain the id and so retrieving additional information of the highlighted item text is ugly.

Example where items are emails:

user1 has item1 { text:"developers developers developers", id:1, title:"ms" }
          item2 { text:"c# development",                   id:2, title:"nice!" }
          ...
          item77 ...

user2 has item1 { text:"nice restaurant", id:3, title:"bla"}
          item2 { text:"best cafe",       id:4, title:"blup"}
          ...
          item223 ...

Now if I use highlighting for the text field and query against “restaurant” I get user2 and the text nice <b>restaurant</b>. But how can I determine the id of the highlighted text to display e.g. the title of this item? And what happens if more relevant items are listed at the end of the item-list? Highlighting won’t display those …

So how can I find the best items of a documents with multiple such items?

I added my two findings as answers, but as I will point out each of them has its own drawbacks.

Could anyone point me to a better solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:49:58+00:00Added an answer on May 15, 2026 at 2:49 am

    You could use use two indices: users->items as described in the question and an index with ‘pure items’ referencing back to the user.

    Then you will need 2 queries (thats the reason I called the question ‘2d Search in Solr’):

    1. query the user index => list of e.g. 10 users
    2. query the items index for each user of the 1. step => best items

    Assume the following example:

    userA emails are “restaurant X is bad but restaurant X is cheap”, “different topic”, “different topicB” and

    userB emails are “restaurant X is not nice”, “revisited restaurant X and it was ok now”, “again in restaurant X and I think it is the best”.

    Now I query the user index for “restaurant X” and the first user will be userB, which is what I want. If I would query only the item-index I would get the item1 of less relevant userA.

    Drawbacks:

    • bad performance, because you will need one query against the user index and e.g. 10 more to get the most relevant items for each user.
    • maintaining two indices.

    Update to avoid many queries I will try the following: using the user index to get some highlighted snippets and then offering a ‘get relevant items’-button for every user which then triggers a query against the item index.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title is a bit complicated, but it fits my problem. I have a
The title is a bit confusing but here's what I'm after: I have a
(Title sounds a bit too fancy but I couldn't find a match so we'll
OK, the title is a bit(lot) cryptic, but that's the best one-line-summary I could
Hi guys sorry for the awkward title but I think it is a bit
Ok I know the title is a bit confusing but here is my problem:
The title is a bit vague but I can't come up with a better
i know, the title is a bit crampy, but it's a weird problem. i'm
The title may be bit confusing but here is what I am facing I
The title is a bit wonky but it's the best I could come up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.