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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:47:17+00:00 2026-06-10T22:47:17+00:00

I am using Lucene for searching in my android app but when I run

  • 0

I am using Lucene for searching in my android app but when I run a complex query it doesn’t return offsets for the terms.

For example:

+content:"word" +(personid:NULL personid:123)
+content:"word" +(personid:NULL)
+content:"word" -personid:123

will not return any offsets for the “word”.

+content:word

Will return offsets.

here is what I am storing in each field

 doc.add(new Field(PERSON_ID_FIELD, request.getPersonId(), Field.Store.YES, Field.Index.NOT_ANALYZED));
 // we don't actually store the content here
 doc.add(new Field(CONTENT_FIELD, request.getContent(), Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_OFFSETS));

Am I missing something? Is there something I need to do in the query to get offsets back?

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-10T22:47:19+00:00Added an answer on June 10, 2026 at 10:47 pm

    If one tries to get an offset from the content field for the term with personid it doesn’t return any offsets. Then by not looping through the entire term list from the query one never gets to the content term of the query. Thus no offsets are returned.

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

Sidebar

Related Questions

I am having trouble searching for an exact phrase using Lucene.NET 2.0.0.4 For example
Normally when using Lucene you set a search query and Lucene gives you some
I'm using apache lucene for indexing and searching in my application. Everything is working
I am searching in lucene with a equals operator implemented like: return new TermQuery(new
I am using the Lucene search engine but it only seems to find matches
In my Grails app, I'm using the Searchable plugin for searching/indexing. I want to
I am using Lucene.Net for indexing and searching documents, and I am using the
I am using Lucene .NET Let's say I want to only return 50 results
I'm using lucene.net (2.3.2 ) and a ported version of the compatible WordDelimiterFilter, but
I am using lucene.Net for searching in my application. I have to search in

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.