You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "AlbertoVPersonal (via GitHub)" <gi...@apache.org> on 2025/02/20 07:51:10 UTC

[I] LuceneNET and SQL Server [lucenenet]

AlbertoVPersonal opened a new issue, #1130:
URL: https://github.com/apache/lucenenet/issues/1130

   Hi,
   
   I have searched in the repo and I have not found similar issues.
   
   ### Context
   
   We are developing a custom search in our app (based on .NET8). And the search is developed in the backend with a database that it does not have the full-text feature.
   
   ### New idea to discuss
   
   I'm thinking about using LuceneNET. 
   Based on my understanding, the library is based on documents.
   I suppose that the implementation would be to read my data from the data store and create as many documents (in memory?) as we need.
   I would like to know whether it is a recommended solution and if someone has implemented a similar solution.
   
   Thanks for advance.
   
   Best regards,
   Alberto


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] LuceneNET with databases [lucenenet]

Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin commented on issue #1130:
URL: https://github.com/apache/lucenenet/issues/1130#issuecomment-2673372016

   Thanks @rclabo for the explanation and example. That is correct. As noted at the top of our [documentation](https://lucenenet.apache.org/docs/4.8.0-beta00017/):
   
   > Lucene.NET is a .NET full-text search engine. Lucene.NET is not a complete application, but rather a code library and API that can easily be used to add search capabilities to applications.
   
   What and how you index is up to you. You could index data from a database, or from JSON posted to an API without a database at all. You can run a batch job nightly in an Azure Function or Windows Service to a large index on disk, or index it in real-time as it changes to an in-memory index. You can even use this in a mobile app with MAUI. There's so many ways to use this library, we can't possibly cover every scenario that people need. So this library is flexible enough to use it however you like. 
   
   Our [homepage](https://lucenenet.apache.org/) has a basic example of how to get started. Replace the `source` variable with data you get from a database.
   
   We welcome having the community publish libraries to NuGet that use Lucene.NET in more opinionated ways, and I do personally think having one in the ecosystem that makes it easier to index data from a SQL database (or EF Core) would be worthwhile. It's just currently beyond the scope of this project. Hope this helps, and let us know if you have any other questions. (Closing this issue as not planned.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] LuceneNET with databases [lucenenet]

Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin closed issue #1130: LuceneNET with databases
URL: https://github.com/apache/lucenenet/issues/1130


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] LuceneNET with databases [lucenenet]

Posted by "rclabo (via GitHub)" <gi...@apache.org>.
rclabo commented on issue #1130:
URL: https://github.com/apache/lucenenet/issues/1130#issuecomment-2671546445

   It's a common and recommended approach for the primary data repository to reside outside of Lucene.NET. In the .NET world, it's very common for data to be stored in SQL Server, although it could just as easily come from MongoDB, PostgreSQL, SQLite, or another source. Typically, when indexing data with Lucene.NET, one document is inserted for each result record. Often, this means inserting one document per source record, but that decision depends on your design needs.
   
   For example, consider a database with a product master and associated product detail records (such as product variations). The master record might be "V-neck Shirt," while the detail records might include variations like "V-neck Shirt, Red, Medium" and "V-neck Shirt, Blue, Small." If you want the Lucene.NET search to return a single result for "V-neck Shirt" regardless of color and size, you would insert one document into Lucene.NET for that product and add the various colors and sizes as indexed terms. Conversely, if you want separate search results for each variation, then you should index each product detail record separately and include the product name from the master record as part of each document.
   
   Note that while Lucene.NET stores its index data on the file system, it also uses memory for caching and performance enhancements. For a deeper dive into its architecture, this whitepaper might be helpful: http://opensearchlab.otago.ac.nz/paper_10.pdf .


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org