Depending on how the publication nodes and research project nodes are setup. Are they both one type but just under different pages or different types? Depending on this you have 2 options:
If they are of different types then slightly easier what you would do in your macro is to test which section you are in and if in publications or projects do a search just for those types using nodetypealias as filter in the search.
The compiler is not recognizing the GroupedOr method:
Error 20 'Examine.SearchCriteria.IBooleanOperation' does not contain a definition for 'GroupedOr' and no extension method 'GroupedOr' accepting a first argument of type 'Examine.SearchCriteria.IBooleanOperation' could be found (are you missing a using directive or an assembly reference?)
different searches on every page
Hi,
The scenario I would like to implement on my new Umbraco project (http://testcjs.ugent.be) is to enable a different on every page.
For example, on the home page I would like to have a search function that does a global search on the website.
On the publications page I would like to have a search function that only searches the publication nodes.
On the Research page I would like to have a search function that only searches the Research Project nodes
etc ...
Is this possible with Examine? Anyone else implemented a scenario like this?
thanks for your help,
Anthony
Anthony,
Depending on how the publication nodes and research project nodes are setup. Are they both one type but just under different pages or different types? Depending on this you have 2 options:
If same type - You will need to implement gathingnode data event and inject in a searchable path into the index then when you are doing the search use the path property as search parameter see more here http://thecogworks.co.uk/blog/posts/2012/november/examiness-hints-and-tips-from-the-trenches-part-2/
If they are of different types then slightly easier what you would do in your macro is to test which section you are in and if in publications or projects do a search just for those types using nodetypealias as filter in the search.
Regards
Ismail
Hi Ismail,
Thanks for this advice. I'll try it out and let yoiu know.
greetings,
Anthony
Hi Ismail,
I think I go for the second solution. My only question is, how can I do a search only on I node type, eg 'MediaArticle'?
My current search query, for a global search is defined like this:
thanks for your help,
Anthony
Anthony,
Regards
Ismail
Oh I see, that's easy. Thanks!
There is a problem with the line:
The compiler is not recognizing the GroupedOr method:
Anthony,
WHen i ever i work with exmaine i just add all fields i want to on into one big field called contents then search on that then there is no groupedor etc also if later new fields are added that i want to search on i dont have to modify code. See http://thecogworks.co.uk/blog/posts/2012/november/examiness-hints-and-tips-from-the-trenches-part-2 there is code on how to munge into one field.
Regards
Ismail
is working on a reply...