Does umbraco have a way to check which website the user is on?
I have two umbraco websites (abc.com and def.com). These websites are exactly the same except for one thing, they both return different search results. Currenly, when I hit my search controller, I check Request.Url.Host to see where the user has come from and I change my SQL query to return the correct results, but I was curious if Umbraco had a simpler way to check which site the user is on. Also, I wanted to check earlier in the pipeline, for example if I wanted to make a site wide change depending on their origin, but I am not sure where in Umbraco I would check this.
Can I use Lucene/Examine to search an external database. I am just using the built in PetaPoco to query my database and map to cusom POCO's. Can I do that with Lucene/Examine? If so, how?
Does umbraco have a way to check which website the user is on?
I have two umbraco websites (abc.com and def.com). These websites are exactly the same except for one thing, they both return different search results. Currenly, when I hit my search controller, I check
Request.Url.Host
to see where the user has come from and I change my SQL query to return the correct results, but I was curious if Umbraco had a simpler way to check which site the user is on. Also, I wanted to check earlier in the pipeline, for example if I wanted to make a site wide change depending on their origin, but I am not sure where in Umbraco I would check this.Hi Saied,
Perhaps this package could be an idea to have a look at Personalization-Groups,
https://our.umbraco.org/projects/website-utilities/personalisation-groups/
Perhaps you need to write your own regarding to check which website the iser is on. The source code for this package is available here https://github.com/AndyButland/UmbracoPersonalisationGroups
Hope this helps,
/Dennis
For your reference, there's also
I'd blow this thread up and ask why you use SQL for searching instead of Examine/Lucene, but I'll leave it. ;)
Can I use Lucene/Examine to search an external database. I am just using the built in PetaPoco to query my database and map to cusom POCO's. Can I do that with Lucene/Examine? If so, how?
Can I use this from Global.asax?
I guess you'll have to do some magic to do your own tables.
It would require some knowledge of Lucene.
I recommend this book:
https://www.manning.com/books/lucene-in-action-second-edition
So SQL is a "cheap" alternative for you, but I highly recommend getting to know Lucene. :)
is working on a reply...