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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:09:15+00:00 2026-05-25T18:09:15+00:00

I am not sure why this is not pulling back documents: The documents being

  • 0

I am not sure why this is not pulling back documents:

The documents being added:

document.Add(new Field("project.id", projectId.ToString(), Field.Store.YES, Field.Index.NO));
                document.Add(new Field("contact.id", entity.Id.ToString(), Field.Store.YES, Field.Index.NO));
                document.Add(new Field("contact.businesspartnerid", entity.BusinessPartnerId.ToString(), Field.Store.YES, Field.Index.NO));
                document.Add(new Field("contact.businesspartner.name", entity.BusinessPartner.Name, Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("contact.emailaddress", entity.EmailAddress, Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("contact.firstname", entity.FirstName, Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("contact.lastname", entity.LastName, Field.Store.YES, Field.Index.ANALYZED));
                document.Add(new Field("contact.fullname", entity.FirstName + " " + entity.LastName, Field.Store.YES, Field.Index.ANALYZED));

The Query in Lucene.Net:

var prefix = "dan";
var fields = new {"contact.emailaddress"};
var filterFields = new Dictionary<string,string>();
filterFields.add("project.id","123456");

var parser = new MultiFieldQueryParser(Version.LUCENE_29, fields, new KeywordAnalyzer());

 var query = new BooleanQuery();
               query.Add(parser.Parse(prefix + "*"), BooleanClause.Occur.MUST);

               if (filterFields != null)
               {
                   foreach (var field in filterFields)
                   {
                       query.Add(parser.GetFieldQuery(field.Key, field.Value), BooleanClause.Occur.MUST);

                   }
               }

The query being passed to Lucene:
query.Query = {+(contact.emailaddress:dan* ) +project.id:123456}

if I remove the parser.GetFieldQuery it works great. When I physically look into the index file there is an entry with the project.id and an entry that starts with “dan”.

Should I be doing something else to facet the search by project.id?

  • 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-25T18:09:16+00:00Added an answer on May 25, 2026 at 6:09 pm

    I ended up changing the way Lucene was storing the project.id:

    document.Add(new Field("project.id", projectId.ToString(), Field.Store.NO, Field.Index.ANALYZED));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure this is a programming question, but we use LaTeX for all our
Not sure this is possible, but looking to write a script that would return
I'm not sure this is possible, but in ruby, you can dynamically call a
I'm not sure this is possible, but is there a syntax to be used
I'm still not sure this is the correct way to go about this, maybe
I am pretty sure this is possible just not sure what is the term
I'm sure this is a fairly trivial problem, but I'm not sure what to
First of all I'm not sure this is even possible, however I need to
Ok I'm working on getting better with python, so I'm not sure this is
Not sure if this is possible or if I'm expressing correctly what I'm looking

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.