Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jason Espin 368 posts 1335 karma points
    Sep 15, 2015 @ 10:32
    Jason Espin
    0

    Examine query returning nodeTypeAlias I have not searched for

    Hi all,

    I have the following Examine query:

    BaseSearchProvider AxumSearcher = Examine.ExamineManager.Instance.SearchProviderCollection["AxumSearcher"];
    ISearchCriteria countryCriteria = AxumSearcher.CreateSearchCriteria(BooleanOperation.Or);
    IBooleanOperation countryQuery = countryCriteria.Field("nodeTypeAlias", "country");
                      countryQuery = countryQuery.Or().Field("nodeTypeAlias", "continent");
                      countryQuery = countryQuery.And().Field("siteNode", culture.Value.Id.ToString());
    ISearchResults countries = AxumSearcher.Search(countryQuery.Compile());
    

    My aim is to retrieve only nodes that are of type country and continent that have to have the siteNode value specified. However, when I receive the results of the query it also seems to have loads of other types of node including homepage and activities. This is because both of these types also have the same siteNode.

    Is there anything I am missing from my query that could be causing it to do this?

    I know that I cannot define that it must return continent and country types as a node cannot be both but there must be a way on ensuring that other node types that I am not interested in are not returned.

    Any help would be greatly appreciated.

    Cheers,

    Jason

Please Sign in or register to post replies

Write your reply to:

Draft