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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:56:09+00:00 2026-06-18T21:56:09+00:00

I’ve seen posts on performing autocomplete across multiple fields but not on performing autocomplete

  • 0

I’ve seen posts on performing autocomplete across multiple fields but not on performing autocomplete on multivalued fields.

My autocomplete feature is working for non-multivalued fields.

My problem is when I run the query on the multivalued field, wherever a document matches that query, all the fields in the multivalued field of that document are returned in the facet results.

Below is my schema, similar to what is proposed in the Solr 4 Cookbook.

 <fieldType name="text_autocomplete" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.WhitespaceTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="25" />
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.WhitespaceTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

<field name="publisherText-str" type="string" indexed="true" stored="false" multiValued="true"/>
<field name="publisherText-ac" type="text_autocomplete" indexed="true" stored="true" required="false" multiValued="true"/>

As you can see publisherText is a multivalued field. I execute a query like this to test the autocomplete feature:

/select?q=publisherText-ac:new&facet=true&facet.field=publisherText-str&facet.mincount=1&rows=0

The query is “new”, and this matches a set of documents. However the facet result set contains the other publisherText values (contained in the multivalued field) for each matching document.

Update: When querying “new”, the result set should include “New York Times” and “Times New Roman” but does not need to solve the infix problem: “Knewton Gazette” does not need to be in the result set.

Is there a way to have the facet result only contain values that match the query?
Or is there a different (better?) way to support the full autocomplete feature that handles multiValued fields more gracefully?

Thanks.

  • 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-06-18T21:56:10+00:00Added an answer on June 18, 2026 at 9:56 pm

    I think that the most optimal way would be to create a separate collection or core (depending if you are using cloud or not) and have your data indexed in a way, that it can be queries for the desired query result. Of course it may not be possible in some cases, but if it is in your case go for it. In such core you would only have fields and data relevant to your autocomplete so in most cases it will be smaller, than the original core, less terms and that should result in faster queries. In addition to that, such core or collection optimized for autocomplete queries and you’ll gain even more performance out of it.

    However if you can’t go for multiple cores/collections approach than highlighting may be the best way to go, if you need filtering. In such case you may want to have term verctors turned on and use FastVectorHighlighting to have better performance of Solr highlighting (http://solr.pl/en/2011/06/13/solr-3-1-fastvectorhighlighting/).

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I need a function that will clean a strings' special characters. I do NOT
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you

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.