+ Reply to Thread
Results 1 to 10 of 11

Thread: Wiki.getSearch problems

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Location
    Girona, SPAIN
    Posts
    547

    Default Wiki.getSearch problems

    Only for: Mindtouch 10

    Before when you searched for [ tag:"whatever with spaces tag" ] it worked perfectly, now it search like:

    tag:whatever with spaces tag

    That's not the correct working way, you have an example here:

    http://developer.mindtouch.com/User:...earch_for_Tags

    The code:

    wiki.getsearch{query: 'tag:"Noticia Interna"', max: 5, sortby: '-date'};

    The previous page it only has to return 1 page, and it returns a lot of them.

    I've filled a bug for it: http://bugs.developer.mindtouch.com/view.php?id=8445

    Thanks in advance,
    Carles.

  2. #2
    Join Date
    Jul 2009
    Location
    Girona, SPAIN
    Posts
    547

    Default

    For the moment if you substitute the "Noticia Interna" for ("Noticia Interna"):

    wiki.getsearch{query: 'tag:"Noticia Interna"', max: 5, sortby: '-date'};

    Change to:

    wiki.getsearch{query: 'tag"Noticia Interna")', max: 5, sortby: '-date'};

    But the first sentence worked on the previous releases

  3. #3
    Join Date
    Sep 2008
    Posts
    195

    Default

    For the new search features we rewrote how lucene queries are parsed, because we had a lot of scenarios that didn't work properly. Looks like the quote string regression snuck in as part of that. I've just committed a fix to trunk and it will be in the next point release
    Arne Claassen - Software Architect
    Found a bug? Report it.
    Follow me on Twitter!

  4. #4
    Join Date
    Jul 2009
    Location
    Girona, SPAIN
    Posts
    547

    Default

    More problems with wiki.getsearch,

    When I add some constratint like -> path:whatever/subwhatever it just doesn't take care of it:

    Code:
     wiki.getsearch("search_criteria",10,'-date','path:whatever/subwhatever');
    It just search all over the wiki not only in the given path.

    Well, it's something with 'path:whatever/subwhatever' becouse if I put the path condition on search_criteria it also just doesn't take care of it.

    Finally I got it working with a search_criteria like:

    "+(search_criteria) +(path:whatever/subwhatever)"

    Carles.
    Last edited by carles.coll; 07-23-2010 at 11:29 AM.

  5. #5
    Join Date
    Mar 2008
    Posts
    1,630

    Default

    I just had the same problem with wiki.getsearch and your solution worked for me.

    This query: "type:wiki AND path:user:neilw/text/*" returned zero results. Specifying "type:wiki" in the "constraint" argument instead, had no effect. Specifying the query as "+type:wiki +path:user:neil/test/*" worked as desired.

  6. #6
    Join Date
    Sep 2008
    Posts
    195

    Default

    Your query does generate an unintended query for which I've filed a bug:

    http://bugs.developer.mindtouch.com/view.php?id=8501

    In the meantime, does this do what you want?

    Code:
     wiki.getsearch("search_criteria",10,'-date','+path:whatever/subwhatever');
    We've changed how lucene queries are built because a lot of scenarios just didn't work as intended. Constraints a bit tricky because combining the constraints we inject with ad-hoc constraints can lead to constraints that are unintentional ORs that allow too much or unintentional ANDs that complete decimate the possible set.

    The best way to figure out whether you are getting the query you want is to put the query and criteria through the search @api call and see what lucene query it actually results in.
    Arne Claassen - Software Architect
    Found a bug? Report it.
    Follow me on Twitter!

  7. #7

    Default

    mgah.

    what is the syntax for wiki.getsearch? man this is the part about dekiscript that is infuriating!

    im trying to list all pages from a folder that has a certain tag, the actual search word doesnt matter

    let pages = wiki.getsearch("",10,'-date','+tag:review +path:FOLDER/');
    doesnt seem to work

    let pages = wiki.getsearch{query: 'tag:mytag AND path:FOLDER/', max: 1, sortby: '-date'}
    doesnt seem to work

    what does work?
    Regards,
    Lars

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts