This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, Is there any way to perform a LS query that includes a fulltext search on a related entity? For example, I want to retrieve all Orders whose parent Customer's name contains "Joe" The documentation/examples on the full text support is a bit on the light side :) Also, I don't see any equivalent to Query.SearchQuery in the LINQ provider. Since your fulltext implentation is scoped at the entity rather than at the field level, would it be possible to create a extension method for IEnumerable<T> that implemented the fulltext search on the entity of type T? var joesOrders = from o in _lscontext.Order Thanks, |
|
|
Hi Greg, This sounds like two requests - one for the extension method or improvement to the API in general, the other on how to index data so you get associated entities? If you wanted to search for, say, orders by the name of the person who ordered it (in a fuzzy manner using Lucene, not a SQL query) then you can override the GetSearchData method on the Order object. You can then return the string that makes up the search data. This means you could concatenate any of the fields you wanted to search over on the Order AND include the name of the customer in that string. It's not ideal, but it gives you some control over what goes in the index (you will still need one field to be attributed as indexed to ensure we know we should be storing search data about that entity). Generally the search will always be more fuzzy than exact, but that's partly the reason for its existence - if it needs to be exact you can often use a SQL query. The idea of searching per field is interesting also, and something we could explore in later versions of LightSpeed but it doesn't sound like it's a show stopper for you currently? I hope that helps, John-Daniel |
|