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

  • Home
  • SEARCH
  • 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 4058144
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:02:33+00:00 2026-05-20T15:02:33+00:00

Lucene does not support it out of the box, so I need some help

  • 0

Lucene does not support it out of the box, so I need some help building my query.

Lets say I have the document with a field value “Develop”

I would like this document to be returned for the searches “Dev” and “lop”.

Maybe creating two queries?

"*keyword" 

and

"keyword*" 

and

"keyword"

?

How would you go about doing this with multiple words? Would you split the sentence/search into a words list and do the previous example for each word?

  • 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-20T15:02:33+00:00Added an answer on May 20, 2026 at 3:02 pm

    What you’re asking is if I understand you correctly not feasible on any large scale search engine.
    Lucene creates an index over keywords using term-document matrix and inverted-file techniques (see links at the bottom). A fully fledged string matching might be very nice to have, but it does not scale: you will never be able to query a decently sized index (say more than a couple of dozen/hundreds of documents) in an acceptable time.

    Still, here are two ideas that might help…

    Syllable tokenization
    To come back to your example with ‘Develop’. As long as you are happy with letting users search for syllables I guess you can do something.
    You would have to create use tokenizer that splits up words in your indexed according to their syllables and create a database index over the syllables. (I am not sure there are built in tokenizers for the English language that can do that and writing one on your own might be tricky…)

    An important thing to note:
    If you would index the full words AND the seperate syllables the size of your index will be much larger than if you only index one of the two.

    However I would not suggest to index only syllables. If you want to also allow your users to search for the full word ‘Develop’ (which I guess you want) this would result in two queries with a logical and between them, namely <‘dev’ AND ‘lop’>. Although Lucene supports such logical constructs in queries they are very expensive. I have personally had some trouble in the past using logical queries in Lucene.

    Stemming
    Another way to somehow arrive at what you’re trying could be to use a brutal form of word stemming (http://en.wikipedia.org/wiki/Stemming) that stems words to their first syllable. (This would allow to search for ‘dev’ but not for ‘lop’…)
    Again, I don’t think such a word stem feature is already in Lucene. Writing one for yourself will be a pain and involve working with/importing huge dictionaries.

    Links
    These might be looking into if you don’t know about search engine internals:
    http://en.wikipedia.org/wiki/Index_%28search_engine%29
    http://en.wikipedia.org/wiki/Vector_space_model
    http://en.wikipedia.org/wiki/Inverted_file
    http://en.wikipedia.org/wiki/Term-document_matrix
    http://en.wikipedia.org/wiki/Tf-idf

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

Sidebar

Related Questions

Wondering how to achieve pagination in Lucene, as it does not inherently support pagination.
Working with a Lucene index, I have a standard document format that looks something
I am building a faceted search with Lucene.NET, not using Solr. I want to
In Lucene.Net, I need to create a query to limit a search to a
Say instead of documents I have small trees that I need to store in
The following code does not delete the document by Term as expected: RAMDirectory idx
Does Lucene produce smaller files sizes if you index short one character Field names?
Each Lucene doc is a recipe, and each of these recipes have ingredients. Im
I am using Lucene 3.5.0 to do some basic search stuff on my website.
Situation:I have an ASP .NET application that will search through docs using Lucene. I

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.