locked
Escaping AQS RRS feed

  • Question

  • Does anyone know the correct way to escape special characters in AQS?

     

    For example

     

    folder:c:\Program Files

     

    Potentially has 2 problems

     

    1. The query is actually 2 terms - items in folder c:\Program AND items containing the word Files

    2. The : after the C could imply that C is a property and that the query should match items where the value of it is \Program

     

    I could try putting the bit that needs escaping in quotes e.g. folder:"C:\Program Files\" but this does not seem to work

     

    For example if I index the Windows SDK a query for uispy in program files should return 4 results from the following query

     

    store:file folder:"C:\Program Files\" name:uispy

     

    But it actually returns none

     

    Changing the query to

     

    store:file folder:'C:\Program Files\' name:uispy

     

    returns the correct 4 results, but is this correct? What happens if there is a ' in the folder name to search?

    Tuesday, February 26, 2008 10:50 AM

All replies

  • Hi,

    As you have noticed, you can use doublequotes to tell AQS that a string should be used "as is". Singlequotes (apostrophes) have no particular meaning to AQS (so your second query above was actually interpreted as "search for 'C:\Program in the folder property and search for Files\' anywhere).
    It's not obvious from what you write above why your original query is not succeeding as it looks like a correct query to me, assuming you indeed installed the files under "C:\Program Files". I take it the files are in the results if you remove the folder: restriction entirely?

    To answer the question in the title though: there is presently no character escape mechanism in AQS, so searching for a doublequote character would present some problems.

    Thanks,
    -- J.

    Wednesday, March 4, 2009 5:54 PM