Copied to clipboard

Flag this post as spam?

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


  • Niclas Schumacher 67 posts 87 karma points
    May 01, 2014 @ 11:34
    Niclas Schumacher
    0

    How to make query in Examine

    Hello search people! 

    i've experimented a bit with some search i'm creating atm. And i would like to keep it in examine, but im not sure if examine is flexible enough for me to be able to create the query that i want. 
    I've created this query in Luke, and it seems to do what i want, but i can't seem to figure out how to create it in examine, hopefully some of you can guide me in the right direction :) 

    This is my Query : +((+nodeTypeAlias:user^7.7 +(fullName:niclas* fullName:schumacher* fullName:niclas fullName:schumacher))

    The point is that i want to search differently depending on the documentType. So i could have a workGroup also, which could look something like : 

    +((+nodeTypeAlias:user^7.7 +(fullName:niclas* fullName:schumacher* fullName:niclas fullName:schumacher)) (nodeTypeAlias:workgroup title:niclas* title:schumacher* title:niclas title:schumacher))

    So this query would search for users and workgroups, but search in their respected fields, and give me a result back containing both documentTypes (depending on the search query, in this example: Niclas Schumacher)

     

    I can't quite figure out how to do such a query in examine, the only methods i find usefull is Field(), And(), Or(), GroupedOr()/and(). - And these can't make a query look like i want it to :(

     

    I hope some of you could help me clearfy this, or if i just should use Lucene directly, though i think examine look nicer :)

     

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 01, 2014 @ 12:06
    Ismail Mayat
    0

    Niclas,

    The whole point of the raw query was to give searchers the options of querying when the fluent api could not generate the query, for most queries you can get away with api but there will be exceptions when you need the raw query.

    Regards

    Ismail

  • Niclas Schumacher 67 posts 87 karma points
    May 01, 2014 @ 12:24
    Niclas Schumacher
    0

    Ismail, 
    yes. But, im just just not sure that this is a case which needs rawQuery, or is it possible to do with examine?

     

Please Sign in or register to post replies

Write your reply to:

Draft