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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:02:59+00:00 2026-06-15T09:02:59+00:00

I was trying Lucene.net for applying fulltext search and was able to use it

  • 0

I was trying Lucene.net for applying fulltext search and was able to use it with the helpof this link
http://www.codeproject.com/Articles/320219/Lucene-Net-ultra-fast-search-for-MVC-or-WebForms

but the it has an example only for some simple data

while i m having a scenario where the two entities are linked with one-to-many relation.

class Product
{
  public int Id{get;set;}
  public int Name{get;set;}
}

class Shop
{
  public int Id{get;set;}
  public int Name{get;set;}
  public List<Product> Products{get;set;}
}

now implementing/(storing this in index as a single table or doc) this is a bit tricky.

Should i create two documents for index?

but then linking would be a problem, if the search was made in Product and it will return result with only Product and not shops.

What is the way out of it? or some other way?

–EDIT—

need to store these 1:N related data in single document as i would be giving the search on any of the field from both the entities.

So even after the result is returned by lucene it has the id available for both entities.

  • 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-15T09:03:00+00:00Added an answer on June 15, 2026 at 9:03 am

    One option is to create a field in your index for each product document, which holds all shop ids.

    Document (Product)

    Name             | Shop
    ------------------------
    Super Product XY | 1 5 7
    

    Now, if you only want to search in one shop you could do something like this.

    +Name:"Super Product" +Shop:5
    

    In general it absolutely depends on your requirements. Do you need to search over all shops and find out, which shop provides a product or do you want to limit your search to a single or multiple shops.

    === Update ===

    If you want to receive the Product-ID and the Shop-ID you can define the Fields ProductID and ShopID as “Field::STORE_YES” (C++ Variant, i don’t know the .NET define).

    (STORE_YES)|(INDEXED_TOKENIZED)| (STORE_YES)
    ProductID  | Name              | ShopID
    --------------------------------------
    1          | Super Product XY  | 1 5 7
    2          | Not good Product  | 2 5 6
    --------------------------------------
    

    From a found Document object you can read the fields ProductID and ShopID, which gives you all you need. ShopID will return as String, you can split it by space (” “) and you have an array of your ShopIDs.

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

Sidebar

Related Questions

I am trying to implement Lucene with cakephp and following this guide http://jamienay.com/2010/01/zend_search_lucene-datasource-for-cakephp/ Am
This is getting quite annoying. Trying to integrate Lucene.Net search with NHibernate and i
I want to use Lucene.NET for fulltext search shared between two apps: one is
I'm trying using NHibernate.Search to get Lucene.NET Score through projections. My domain object implements
I'm trying to incorporate Lucene.net in my web search. Currently I have a lucene.net
I am trying to use Lucene to search for names in a database. However,
I'm trying to use lucene 4.0 snapshot version, however StandardAnalyzer is missing in this
We are trying to use H2 Lucene full text search functionality. It works great.
I'm trying to use Hibernate Search so that all writes to the Lucene index
I use Lucene.Net to search text files in a WPF app and was thinking

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.