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 1958560
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:21:18+00:00 2026-05-17T08:21:18+00:00

I have solr query that simply returns the most recent items in the index.

  • 0

I have solr query that simply returns the most recent items in the index. However I’m trying to optionally if categories are passed in have it the category field weighted such that if there are matches for the category field then those are weighted higher but still have those without categories show.

so the document structure looks something like this:

{id:1, title:"sometitle", category:['cat1','cat2']},{id:1, title:"sometitle", category:[]}

my general query is something like:

title:*

but if categories are passed in i’d do the same title:* query but i’d like the results to be sorted such that those results with category fields that match the categories passed in are weighted higher

I tried boost query (bq) but that didn’t work (which makes sense because my query is to return all) and i am sorting primary by score and doing a secondary sort on a “created” field

  • 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-17T08:21:21+00:00Added an answer on May 17, 2026 at 8:21 am

    If I understand your question right, you want certain documents to be scored higher regardless of your query, right? Those documents which have categories in them should be better than ones without categories?

    If this is what you want, see: How can I increase the score for specific documents?.

    Alternatively, you might be asking to boost things only if you query for them. Your query should be

    +(title:"title to search for") category:"categories to boost"
    

    This will only find things which match the title, but it will boost the score if it has a category you included in that query.

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

Sidebar

Related Questions

I'm trying to query Solr for entries that either have a certain value in
I have installed a servlet (solr) that requires that I set the variable solr.solr.home
I have a simple query to a Solr instance using SolrNet, But for some
Solr newbie here. I have created a Solr index and write a whole bunch
I have created a request handler in Solr that uses dismax and limits my
I've just started trying to use Solr, and already I think that I'm attempting
I have a Solr index with document fields something like: id, body_text, date, num_upvotes,
We have set up an Solr index containing 36 million documents (~1K-2K each) and
I have a Solr schema that has a url field: <fieldType name=url class=solr.TextField positionIncrementGap=100>
I have an index that stores birth-dates, and I would like to search for

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.