none
FullTextSqlQuery and Multivalued(ARRAY) comparisons RRS feed

  • Question

  • Hi

    I have problem with FullTextQuery on Sharepoint 2010 with Enterprise Search (no FAST) , when I try to execute following code:

    var query = new FullTextSqlQuery(site);
    query.ResultTypes = ResultType.RelevantResults;
    query.QueryText = "SELECT Title FROM SCOPE() WHERE LookupField = ANY ARRAY['Value1', 'Value2']";
    ResultTableCollection queryResults = query.Execute();
    

    I get QueryMalformedException with message: "Your query is malformed. Please rephrase your query."

    Crawled Property for this LookupField is configured as follow:

    - Variant Type: 4127

    - Data Type: Text

    - Multi-valued: Yes

    Manage Property:

    - Has Multiple Values [Checked]

    - Include values from all crawled properties mapped [Checked]

    and the source field has type lookupfield.

    I've tested different variation of this properties but I'm always getting the error...

    - Should ARRAY clause work work with lookupfield? If yes then how this field should be set?

    - Are the Manage  and Crawled Properties configured correctly?


    BTW This query worked on MOSS 2007

    BR

    igby

    • Moved by GreggPJ - MSFT Friday, July 6, 2012 2:06 PM moving to correct forum (From:SharePoint 2010 - General Questions and Answers)
    Tuesday, July 3, 2012 12:34 PM

All replies

  • 

    Hello,

    Thank you for your post.

    This is a quick note to let you know that we are performing research on this issue.

    Thanks,


    Pengyu Zhao

    TechNet Community Support

    Friday, July 6, 2012 3:32 AM
  • Hi,

    I have the same problem...
    Query works great in MOSS2007 in SP2010 it doesn't.

    Did you find a solution for this?

    Grtz

    Vandeput


    Follow me @SPVandeput

    Thursday, July 26, 2012 10:06 AM
  • Hi,

    I replaced ARRAY syntax with OR conditions, see example below.

     LookupField = ANY ARRAY['Value1', 'Value2']

    is equal to this:

     LookupField = 'Value1' OR LookField = 'Value2'

    I'm afraid that not many people are using the "ARRAY", so the MS will not fix this:/

    BR

    Thursday, July 26, 2012 10:25 AM
  • Tnx man :-)
    I already did the same thing in the past, I was just wondering if there was an other way...

    Follow me @SPVandeput

    Thursday, July 26, 2012 11:27 AM
  • 

    Hello,

    Thank you for your post.

    This is a quick note to let you know that we are performing research on this issue.

    Thanks,


    Pengyu Zhao

    TechNet Community Support

    Do you have an update on this? It is causes an issue for our current project.

    As far as I can see LookupField = ANY ARRAY['Value1', 'Value2'] is not the same as LookupField = 'Value1' OR LookField = 'Value2' because the field is multi-valued so if the field='Value1, Value2' the equality fails.

    • Edited by Heley Thursday, January 16, 2014 12:06 PM
    Thursday, January 16, 2014 11:43 AM