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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:52:23+00:00 2026-05-23T10:52:23+00:00

For some reason lucene is not returning any results when it should be. Here

  • 0

For some reason lucene is not returning any results when it should be. Here is the ‘search’ code

Dim util As New IndexerUtil()
Dim dir As Lucene.Net.Store.Directory = FSDirectory.Open(New DirectoryInfo(util.getIndexDir()))
Dim indexSearcher As New IndexSearcher(dir, False)
Dim indexWriter As New IndexWriter(dir, New SimpleAnalyzer(), False, indexWriter.MaxFieldLength.UNLIMITED)

Dim term As New Term("id", "346")
Dim query As New TermQuery(term)
Dim topDocs As TopDocs = indexSearcher.Search(query, 100)

There are no scoreDocs (results) in topDocs. I know for a fact that there is a document in the index where the id field is equal to 346 however for some reason the search is not finding it. Here is how the “id” field is being created

doc.Add(New Field("id", ID, Field.Store.YES, Field.Index.ANALYZED)) //ID is an integer

I have other fields to search on and those work fine (e.g. if I search on the subject field I get the results I should)

  • 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-23T10:52:24+00:00Added an answer on May 23, 2026 at 10:52 am

    SimpleAnalyzer uses LetterTokenizer, which only returns letters.

    Consider using the KeywordAnalyzer instead for the id field.

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

Sidebar

Related Questions

For some reason my code works for all the 10 digit numbers but not
For some reason I am getting the number or rows and not the results
For some reason CodeIgniter is not connecting to my SMTP server, anyone have any
For some reason this code is not checking the current password with the database
For some reason, my following line of code is returning a 0. int bac
For some reason I can't find any results from my valid index of 3552
For some reason my DB is not being created and i'm not getting any
For some reason I'm really struggling with this. I'm new to wpf and I
For some reason I am not able to use the TextFlow element in WPF.
For some reason, the following code never calls Event::Event(Event&& e) Event a; Event b;

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.