Copied to clipboard

Flag this post as spam?

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


  • Miha 5 posts 95 karma points
    1 week ago
    Miha
    0

    Examine Lucene Raw Query

    Hello there folks, I got asked to make some changes on a project that was developed by someone else,problem is,whoever made it,made bad searching for it so I should get into it and fix it. I am a bit stuck with searching in umbraco v8,with umbraco v7 it was easy to make complex query that were not achievable/very complex with the Fluent API(gives me a headache) and make search based on the query.

    e.g. nodeName:(+fast~ +cars~)^20 nodeName:(fast cars)^16 nodeName:(fast cars*)^12

    it may be silly example but you get the point. I've been digging around it for hours,but can't seem to find to make it work in v8 like it worked in v7. I am trying to avoid using Fluent API for my searches 'cuz i don't know if it's even possible to do it(it requires quite complex searches).

    If anyone knows how to make use of raw queries in v8 I would appreciate it. I didn't manage to find anything related on the topic. I apologise if it was already answered/asked.

    Tnx.

  • Paul Seal 509 posts 2789 karma points MVP 4x c-trib
    1 week ago
    Paul Seal
    0

    Hi I did a 5 part series about searching in Umbraco v8. You might find it useful.

    This particular episode shows you how to use fuzzy search and boosting.

    https://youtu.be/v-F7Ot1fJJ8

    Cheers

    Paul

  • Miha 5 posts 95 karma points
    1 week ago
    Miha
    0

    thank you for reply,great video for v8 , still I wonder if i could do raw queries insted of Fluent API,for me it's lot easier to make raw query then to do extension methods or complex query via Fluent API.

    cheers...

  • Paul Seal 509 posts 2789 karma points MVP 4x c-trib
    1 week ago
    Paul Seal
    0

    Hi

    Yes you can definitely do raw queries in v8. I’m not at my desk until tomorrow though so I can’t dig out the code for you but it should be straight forward and similar to v7.

    Paul

  • Miha 5 posts 95 karma points
    1 week ago
    Miha
    0

    I've been trying that for hours, with no succes idk what am i doing wrong,thank for help, enjoy your day

    Cheers

  • Miha 5 posts 95 karma points
    1 week ago
    Miha
    0

    Still no luck, everything i found includes Fluent API query, it seems it is not that straight forward in v8 as it was in v7 :) Seems I will have to figure it out using Fluent API which is sadly overkill for complex queries.I've seen people trying to get this for quite some time with no luck.Fluent API can't combine e.g. Fuzzy and Boost together.

    Cheers

  • Miha 5 posts 95 karma points
    16 hours ago
    Miha
    100

    Well I managed to make it,it was quite simple but with a bit of confusion cuz' it parses query a bit different then it did in v7.There were a lot of errors in the beginning cuz' of parser but through NativeQuery method you can make it with raw string qurey,just be carefull as I said you have to be more carefull with query string cuz it is not that forgiving like v7 that did a lot of job for you.

Please Sign in or register to post replies

Write your reply to:

Draft