How can I execute MOSS FullTextSqlQuery and filter people's results using skill-driven?

I am having problems with MOSS FulltextSqlQuery when I try to filter People results in their skill property using the CONTAINS predicate. Let me demonstrate:

A query without filters returns the expected result:

SELECT AccountName, Skills
from scope()
where freetext(defaultproperties,'+Bob')
And ("scope" = 'People')

Result

Total Rows: 1
ACCOUNTNAME: MYDOMAIN\Bob
SKILLS: Numchucks | ASP.Net | Application Architecture

But when I add the CONTAINS predicate, I no longer get the expected result:

SELECT AccountName, Skills
from scope()
where freetext(defaultproperties,'+Bob')
And ("scope" = 'People')
And (CONTAINS(Skills, 'Numchucks'))

Result

Total Rows: 0

, SOME ARRAY, , CONTAINS Skills. CONTAINS , "". Skills ( ) " " SSP:

HTTP:///ssp/admin/_layouts/schema.aspx ConsoleView = crawledPropertiesView & = People

- ?

+3
2

, (Microsoft SharePoint Developer Support), , API ManagedProperty, FullTextQueriable true. , . -.

    using Microsoft.Office.Server;
    using Microsoft.Office.Server.Search.Administration;

    private void EnsureFullTextQueriableManagedProperties(ServerContext serverContext)
    {
        var schema = new Schema(SearchContext.GetContext(serverContext));
        var managedProperties = new[] { "SKILLS", "INTERESTS" };
        foreach (ManagedProperty managedProperty in schema.AllManagedProperties)
        {
            if (!managedProperties.Contains(managedProperty.Name.ToUpper()))
                continue;

            if (managedProperty.FullTextQueriable)
                continue;

            try
            {
                managedProperty.FullTextQueriable = true;
                managedProperty.Update();
                Log.Info(m => m("Successfully set managed property {0} to be FullTextQueriable", managedProperty.Name));
            }
            catch (Exception e)
            {
                Log.Error(m => m("Error updating managed property {0}", managedProperty.Name), e);
            }
        }
    }
+2
SELECT AccountName, Skills
from scope()
where freetext(defaultproperties,'+Bob')
And ("scope" = 'People')
And (CONTAINS(Skills, 'Numchucks*'))

* .

:

, SQL FullTextSqlQuery:

FREETEXT()

()

0

Source: https://habr.com/ru/post/1733450/


All Articles