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 Guys, I have some Entities which I want to index. I have a Customer entity which is (inheritance) a Person. When I index Person I get records in Lucene but they are all empty and search does not work. I'd like to search both on Person and on Customer (which is a Person with a discriminator). Sample project is included, with unittests and database backup file (MSSQL 2008). The LuceneIndex path is set in the FixtureSetUp and the index is rebuild in the FixtureSetUp as well. I'm running the 12-01-2010 nightly of LS3, but we also experienced this bug with ls 2. Hope you can help me Regards, Rolf |
|
|
Hi Guys, I retested this with the 15-01-2010 nightly and it is still broken. Any update on this, this bug is holding us back from migrating to LS3. Regards, Rolf |
|
|
Hi Rolf, I will have a look into this and update this thread with what action we are taking. Kind regards, John-Daniel Trask |
|
|
Hi Rolf, Thank you for the detailed tests - they helped a lot. I have made a change to how the search works which would help some of the tests pass but not all. Now, when indexing a all your Person objects we will store the search data for all of them. There was an issue where LightSpeed internally would realise that a Person was in fact a Customer, check the search data and get an empty string back because Customer had no index fields (even though the parent, Person, did). This means now when you index you will be able to search and get back any person in the system. I have not improved the search so that a search on the Customer type would return only customers. Instead you will need to always search for a Person type and then filter yourself in your code. Something like: foreach(var result in searchResults) The reason for this is because of how the search index is stored - we store the base type that is indexed. We could go and expand upon this but it would be a breaking change to everyone who uses the LightSpeed for searching currently (some use Lucene directly over the store for other systems so we would not want to break those as well). We could have included the filtering ourselves in our Search API but while this would save the developer writing a few lines of code I could also see issues arising where somebody wonders why they're fetching 2000 entities from the database but returning 3 (or something similar). I appreciate your feedback on this change and I hope it gives you enough room to move forward with your project. The change will be in the nightly build dated 21st of January. I hope that helps and makes sense - let me know if you have any further questions. John-Daniel Trask |
|
|
Hoi John-Daniel,
This fix sounds great and will definitely fix our issue. The search on Customer is a "nice to have" for me and I understand the difficulties in implementing this. I will retest the issue with the nightly from the 21st when it's available and mark your anwser as the solution for this problem as soon as I can confirm the fix works. Thanks for the help. Regards, Rolf |
|
|
Hoi John-Daniel, I retested the issue and it is fixed now. Thanks again Regards, Rolf |
|
|
Excellent, thank you for the update Rolf :-) |
|