Copied to clipboard

Flag this post as spam?

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


  • Deci 19 posts 48 karma points
    Sep 07, 2011 @ 13:47
    Deci
    0

    examine. 1 Field, 2 possibles using OR

    Hi, 

    Just installed Umbraco for an internal project that hinges on a fairly simplistic search function on a limited data set working. 

    I have 1 radio group and 2 checkbox lists with about 5 options in each. I am getting thwarted on the very first and most simple query to build up to my total complete solution. Right now I am using a razor macro with inbuilt values as I test it. This first failing query is only using the radio group as search params. This is the query creation part in the macro:

    sc.Field("productCategory", "5").Or().Field("productCategory", "8");

    This will return the product with the category of 5 but not 8. If I swap the 8 and 5 around, I will get the 8 and then not the 5. The Lucene query works in Luke and returns both. If I use the RawQuery in examine it works so I must be doing something wrong in examine in structuring this.

    The query will get more complicated than above as I add the 2 checkbox lists into the equation but I can get those working fine in Luke. 

    Is there any reason, other than readability I shouldn't just continue with using the RawQuery method? I have copied some examples verbatim from codeplex and FarmCode and a lot of them appear depreciated and give compilation errors. Using RawQuery, I appear to be isolating myself from API changes to Examine.

    Thanks, Deci.

     

Please Sign in or register to post replies

Write your reply to:

Draft