none
fast search syntax for multiple paths RRS feed

  • Question

  • Greetings,

    I am having little problem with the URL syntax when having a scope of two different paths.  Here is what I have:

     

    http://Enterprise/pages/results.aspx?u=file%3A%2F%2Fserver1%2Fdata%2folder1+file%3A%2F%2Fserver2%2Fdata%2Ffolder2&k=mykeywords

    I also try this syntax:

    http://Enterprise/pages/results.aspx?u=file%3A%2F%2Fserver1%2Fdata%2folder1%20OR%20file%3A%2F%2Fserver2%2Fdata%2Ffolder2&k=mykeywords

     

     

    If I search ONE path at a time, it works fine.  

    http://Enterprise/pages/results.aspx?u=file%3A%2F%2Fserver1%2Fdata%2folder1&k=mykeywords

     

    Your help is truly appreciated.

     

    John.

    Monday, January 9, 2012 7:29 PM

Answers

  • try this using the managed property path and do a property search like this:

     

    k=keywords AND (path:"file://server1/folder" OR path:"file://server2/folder)


    Sanjaya
    • Marked as answer by JP_L Friday, April 20, 2012 8:45 PM
    • Unmarked as answer by JP_L Friday, April 20, 2012 8:45 PM
    • Marked as answer by JP_L Friday, May 4, 2012 6:39 PM
    Wednesday, January 11, 2012 4:01 PM
  • Hi John,

    When using scopes, you're not referencing to a scope via the &u parameter but with &s.

    Read this article which explains how to create scopes in FAST.

    http://technet.microsoft.com/en-us/library/ff453895.aspx

    The correct FQL syntax for multi-url query is:

    urls:starts-with:or("address 1","address 2")

    or

    urls:starts-with:("address 1") or urls:starts-with:("address 2")

    You can also switch the starts-with operator with equals, but that's for exact pages only, not for sub-sites drilldown.

     

    Amir

    • Marked as answer by JP_L Friday, April 20, 2012 8:42 PM
    Tuesday, January 10, 2012 7:07 AM

All replies

  • Hi John,

    When using scopes, you're not referencing to a scope via the &u parameter but with &s.

    Read this article which explains how to create scopes in FAST.

    http://technet.microsoft.com/en-us/library/ff453895.aspx

    The correct FQL syntax for multi-url query is:

    urls:starts-with:or("address 1","address 2")

    or

    urls:starts-with:("address 1") or urls:starts-with:("address 2")

    You can also switch the starts-with operator with equals, but that's for exact pages only, not for sub-sites drilldown.

     

    Amir

    • Marked as answer by JP_L Friday, April 20, 2012 8:42 PM
    Tuesday, January 10, 2012 7:07 AM
  • Hi Amir,

    Thanks much for your response.  Here is what I have observed so far:

    1.  For the link http://technet.microsoft.com/en-us/library/ff453895.aspx you provided, we have already set up that way.  

    2.  I have no problem with the FQL syntax.  We use the awesome FASTSearch tool from Codeplex to get the correct syntax.  However, I still have little problem converting the FQL syntax into the URL syntax.

    To further explain what I am trying to accomplish here:

    User want to search in two different paths (file shares) in their browser with any keyword.   

    Keyword:  mykeyword

    File share 1: \\server1\data\folder1

    File share 2: \\server2\data\folder2

    If I search in EITHER file share (one at a time) the results return correctly as:

    http://Enterprise/pages/results.aspx?k=mykeywords&s=file%3A%2F%2Fserver1%2Fdata%2folder1

    OR

    http://Enterprise/pages/results.aspx?k=mykeywords&s=file%3A%2F%2Fserver2%2Fdata%2folder2

    I would like to know how to construct the right URL syntax which it searches in two fileshares.....

    I hope my explanation is clear enough.

    Once again, thanks for your help and I am looking forward to getting help from you.

    John.

     

    Tuesday, January 10, 2012 5:31 PM
  • Hi again,

    If I understand it correctly, user is selecting where to search (types in URLs or some other method), and it's not constant so you can't create a scope.

    I don't know of such syntax, but try also the Sharepoint Search Forums, cause contextual scopes also exists without FAST installed.

    I have something, but it's complicated:

    First, decide on a special separator (; or term) between URLs

    Extend CoreResultsWebPart, override GetXPathNavigator capture the &u= parameter (or another parameter name of your choice) from the URL, split according to the separator and "reprogram" the query before it is sent to the QR Server to contain both URLs.

     

    Amir

     

    Wednesday, January 11, 2012 7:04 AM
  • try this using the managed property path and do a property search like this:

     

    k=keywords AND (path:"file://server1/folder" OR path:"file://server2/folder)


    Sanjaya
    • Marked as answer by JP_L Friday, April 20, 2012 8:45 PM
    • Unmarked as answer by JP_L Friday, April 20, 2012 8:45 PM
    • Marked as answer by JP_L Friday, May 4, 2012 6:39 PM
    Wednesday, January 11, 2012 4:01 PM
  • Hi Sanjaya,

    Sorry to take time to response back to your suggestion.  How do you "translater" that line into URL format?  

    @ Amir:  I apologize for not explaing the whole story.  Some of the external website who would like to their search to our FAST search site.  So in their page, they add a form and point to our result page like the one below:

        <form name="FASTSearch" method="GET" action="http://FastSearchServerDEV/pages/results.aspx">
            <input type="text" name="k" size="40" maxlength="256" value="" />
            <input type="hidden" name="r" value="path:yoursite.web.com" />
            <input type="submit" name="btnG" value="Search" />
        </form>

    As you see, this form works perfectly.  However, they want to search more than ONE site or fileshare.  How do I modify to add additional URL in this form?

    Thanks all.


    • Edited by JP_L Friday, May 4, 2012 6:21 PM
    Friday, April 20, 2012 8:50 PM
  • The trick to get the URL format is to use the "Advanced" Search Web Part to build your SharePoint Search Query. You can then see the syntax in the url.



    Benjamin Niaulin Blog: http://bniaulin.wordpress.com

    Twitter: @bniaulin

    Thursday, December 20, 2012 3:16 AM