Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

SearchCenter XML

  Asked By: Colt    Date: Jul 10    Category: Sharepoint    Views: 1431

I can't figure out the right query for my Properties "property" within
search center.

I was able to get <Query>FileExtension='pdf'</Query> to work.

I'm trying to get <Query>FileExtension contains 'pdf'</Query> to work
and so I am trying several different syntax.

msdn2.microsoft.com/en-us/library/ms466955.aspx

FileExtension is a valid property but is not a PropertyRef.

When I use the syntax below, I get the error: "Property doesn't exist or
is used in a manner inconsistent with schema settings."

<Query>

<Context>

<QueryText language="en-us" type='STRING'>

<Where>

<And>

<Contains>

<FieldRef
name='FileExtension' />

<Value
type='string'>pdf</Value>

</Contains>

</And>

</Where>

</QueryText>

</Context>

</Query>

Do I need to use PropertyRef instead of FieldRef?

I try MSSQLFT syntax

msdn2.microsoft.com/en-us/library/ms470518.aspx

I know the query works because I executed it in a 3rd party Search
Tester Tool.

When I put it in to context of SearchCenter properties I get the error:

Error while executing web part:
Microsoft.Office.Server.Search.WebControls.SrhdcGenericException: Your
search cannot be completed because of a service error. Try your search
again or contact your administrator for more information. --->
Microsoft.Office.Server.Search.Query.QueryMalformedException: Your query
is malformed. Please rephrase your query.

<ResultType DisplayName="PDFs" Name="currcatalog">

<Query>

<Context>

<QueryText language="en-us"
type='MSSQLFT'>

SELECT Title, Path, Description,
Write, Rank, Size FROM Scope() WHERE FileExtension = 'pdf'

</QueryText>

</Context>

</Query>

<PropertyRef Name="Title" />

</ResultType>

Yeah I realize I could just use scopes, but I'm trying to learn a new
skill, and the CAMeL is kicking my butt.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on SearchCenter XML Or get search suggestion and latest updates.




Tagged: