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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:30:07+00:00 2026-05-25T16:30:07+00:00

I have what I think is a simple solr exercise, but I’m unsure what

  • 0

I have what I think is a simple solr exercise, but I’m unsure what to use.

I have a field of names, e.g. Joe Smith and Jack Daniels and Steve. They could each be one name or two names. I want to be able to search this s.t. if you search for “Danie” you get everything that has a first or last name that starts with “Danie”. Three example returns would be “Danielle”, “Steven Daniels”, and “Danier Daniellson”.

I would also like it so that the preference is given to the first name.

So two questions would be do I need to use a copyField and break up the names into first and last name? And what would my analyzer look like?

Edit: Two edits on the searching ability.
1. Something like “Joe S” should return all users that look like “Joe S*”
2. If a user searches with an “&” character, that should be included in the search and not used as an operator.

  • 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-25T16:30:08+00:00Added an answer on May 25, 2026 at 4:30 pm

    To solve your first part I suggest the following solution:

    index your fields twice:

    • once with solr.KeywordTokenizerFactory – that will index your entire field as it is. It will not be splitted into tokens. This will be useful for boosting results with the preference given to the first name.
    • once with WordDelimiterTokenizerFactory or StandardTokenizerFactory

    You can find more about these tokenizers here: http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters

    After you indexed them in two filters with different tokenizers you just use boost query to boost your results from one field (the one with preference given to the first name) as it is explained here: http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_make_.22superman.22_in_the_title_field_score_higher_than_in_the_subject_field


    If a user searches with an “&” character, that should be included in the search and not used as an operator.

    For this part you either use DisMax query http://wiki.apache.org/solr/DisMaxQParserPlugin or when you make a request use “&” instead of &
    Also you need to use a tokenizer like WhiteSpaceDelimiter to just keep other characters in tokens.

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

Sidebar

Related Questions

I have what I think is a simple question but I can't get it
I think I have a pretty simple goal but cant seem to reach it.
I have what I think should be a fairly simple mapping issue, but not
I think I have a simple bug somewhere but I can't see it! In
I think I have a simple problem but I can't see the solution. When
I think I have understood how MeasureOverrride works, but I am trying to use
I have what I think is a very simple question related to the use
I have what I think is a simple problem but have been unable to
I have -- what I think -- is a simple question. Here's my code:
I think I have got something simple wrong here. I am trying to pass

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.