I guess in theory you could get it to work issue is why are trying todo this?
So one issue may be on rebuild you click it and internal index rebuilds but what about the data from this other data source?
Are you doing this because you want to search over 2 indexes? Or you have this related data in third party data source that needs to be part of the umbraco node but only for search? If its the former then you can do multiindex search if its the latter then i would have save action on node and then using webservice or the like that the related data and inject that in as a field.
Basic idea is trying to avoid to query multiple sources (need to fetch AType and BType kind of records, where AType is stored in sql custom table, BType is umbraco doc type kind), so if I could insert the AType records as if they were umbraco docs I wouldn't have the need to search sql (source 1) and umbraco index (source 2) to fetch all data (Makes pagination based on custom properties rather complex), but only the umbraco index
You need multi index search its v easy. So maybe use Richards package to give you the second index. Then you create new searcher (btw this is all covered on the examine course lol) in the ExamineSettings config file eg:
Ah cool, one day I'll make it to the course ;-)
Multi-index search seems a good solution!
About the search in internal > yes, makes sense in our environment to sometimes also search for content not yet published (without going into too much tech details, it involves some complex data validation)
Anyway, whether it were published or non published content, you're multi index solution seems a good candidate!
One thing to note with the custom index. When you have custom indexer you have ability to do full rebuild only so if that db data changes you will need a way to update. If the data is not changing very often then you could have scheduled job which rebuilds the index say once a night.
However if you need instant updates then you will need to look at some kind of trigger to notify a change has happened on a record on the db then you can index just that one row. For umbraco indexes you do not have this worry as we have events that fire that examine listens to.
Cool, the only other thing is you may need to fiddle with your query a bit so that you end up searching on both indexes because you will have umbraco content with all its fields including core properties which you may or may not search on and the db properties which will no doubt be different.
Adding custom data into "default" umbraco index sets
Hi,
I was wondering if it would be possible to index non umbraco custom data into existing default index sets?
Example: Fetch a record from a custom sql table, EntityA and index as if it were a node
More or less something like this:
So, this custom record would need to end up in the Internal index, as with standard content and media
Config slight change (from what I can read online) on the ExamineIndexProviders/providers section for the InternalIndexer
Q1: Possible (Can't make it working atm, but could a config issue as well)
Q2: Yay or nay?
Regards, --Dirk
Dirk,
I guess in theory you could get it to work issue is why are trying todo this?
So one issue may be on rebuild you click it and internal index rebuilds but what about the data from this other data source?
Are you doing this because you want to search over 2 indexes? Or you have this related data in third party data source that needs to be part of the umbraco node but only for search? If its the former then you can do multiindex search if its the latter then i would have save action on node and then using webservice or the like that the related data and inject that in as a field.
Regards
Ismail
Hi Dirk,
Maybe not entirely what you are looking for but Richard Soetemann created a package to store data from database in to a examine index.
https://soetemansoftware.nl/blog/examine-db
Dave
Exactly, not relevant in our case, I know how to create custom indexes based on your custom data... it's the single source search i'm after
Hi Ismail,
Basic idea is trying to avoid to query multiple sources (need to fetch AType and BType kind of records, where AType is stored in sql custom table, BType is umbraco doc type kind), so if I could insert the AType records as if they were umbraco docs I wouldn't have the need to search sql (source 1) and umbraco index (source 2) to fetch all data (Makes pagination based on custom properties rather complex), but only the umbraco index
But your multi-index search is triggering my attention, anything I can lookup online in docs?
Dirk,
You need multi index search its v easy. So maybe use Richards package to give you the second index. Then you create new searcher (btw this is all covered on the examine course lol) in the ExamineSettings config file eg:
type="Examine.LuceneEngine.Providers.MultiIndexSearcher, Examine" analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcards="true" indexSets="ExternalIndexSet,PDFIndexSet" />
Obviously replace indexSets value with names of your index sets.
Then in your code:
And build up your query and off you go. Btw how come you are searching on internal do you have to search on unpublished content?
Regards
Ismail
Ah cool, one day I'll make it to the course ;-) Multi-index search seems a good solution!
About the search in internal > yes, makes sense in our environment to sometimes also search for content not yet published (without going into too much tech details, it involves some complex data validation)
Anyway, whether it were published or non published content, you're multi index solution seems a good candidate!
Huge thanks for the help!
--Dirk
Dirk,
One thing to note with the custom index. When you have custom indexer you have ability to do full rebuild only so if that db data changes you will need a way to update. If the data is not changing very often then you could have scheduled job which rebuilds the index say once a night.
However if you need instant updates then you will need to look at some kind of trigger to notify a change has happened on a record on the db then you can index just that one row. For umbraco indexes you do not have this worry as we have events that fire that examine listens to.
Regards
Ismail
I never replied on your last comment (shame on me!)... I will now!
Don't need immediate updates as data is being pushed from Oracel to sql db 1x/day, so we can schedule this import/publish/index routine easily.
So, no triggers involved, except for triggering the import!
Good feedback though, may help others struggling to get this up and running!
Cheers and super tak! for your help!
--Dirk
Dirk,
Cool, the only other thing is you may need to fiddle with your query a bit so that you end up searching on both indexes because you will have umbraco content with all its fields including core properties which you may or may not search on and the db properties which will no doubt be different.
Dont forget to mark solution ;-}
Fair point, I need to mark your suggestions as solution, I was probably waiting for the friendly our bot to remind me ;-)
Our search query isn't too complex and doesn't involve any of the standard props, so we're covered in that area.
Bit too far off topic to go into the tech details of the solution, we'll have a chat one day on the why of all this...
Again, #h5yr
--Dirk
Karma sent your way!
is working on a reply...