简体   繁体   中英

Sharepoint 2010 FullTextSQLQuery not returning all results

I'm currently having a very strange issue.

This is the query i'm using:

string queryText = string.Format("SELECT Path, TelefoneContacto, EmpresaContacto, DireccaoContacto, MailContacto, TelemovelContacto, NomeContacto FROM scope() WHERE FREETEXT(NomeContacto, '{0}') AND (CONTAINS(Path,'/Contactos/Pages/')) ORDER BY \"NomeContacto\" ASC", keyword);
FullTextSqlQuery query = new FullTextSqlQuery(site);
query.ResultTypes = ResultType.RelevantResults;
query.EnableStemming = true;
query.TrimDuplicates = true;//alterado 4 Junho 2012
query.Hint = QueryHint.OptimizeWithPropertyStore;
query.KeywordInclusion = KeywordInclusion.AllKeywords;
query.Culture = SPContext.Current.Web.Locale;
query.RowLimit = 200;
query.QueryText = queryText;

Now, an example.

The column in which i'm searching is "NomeContacto". Imagine i'm searching for a person whose NomeContacto = "Rodrigo José Amaral Costa Nunes". If i search "Costa", it returns 38 results, but none are the above.

However, if the keyword is "Rodrigo Costa", then the only result (correctly) is the person above.

Is there even an explanation for this?

Thanks, but i solved it.

Turns out that it was the

query.TrimDuplicates = true;

line that was causing the issue. I changed it from true to false and it now returns 10 more results in the "costa" search.

However, this does not make any sense. TrimDuplicates is for duplicate values, why was it limiting the results for completely different pages?

Thanks anyway

You can try to specify locale for you content in FREETEXT predicate

CONTAINS | FREETEXT
([<column_identifier>,]'<content_search_condition>' [,LCID])

More info about localizaed searches here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM