Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

FullTextSqlQuery does not retrieve results when url contains hyphens

$
0
0

There's an issue with querying list items and documents using a FullTextSqlQuery in one of our meeting sites. In our site collection we have a couple of meeting sites and most of them don't have any hyphens (-) in the url. Those sites work fine, but in a couple of sites have multiple hyphens present in the url. For example: http://dev/meeting/a-gremia-n/meetings/20102-gremia-dev/

We are trying to query all the agenda items and meeting documents of the list and since items don't have a WebId, we are trying to retrieve them by matching the url. The query looks like this:

SELECT WebId, Url, Site, ContentType, ItemID, Title, ModifiedBy
FROM scope()
WHERE (SCOPE = "All Sites" AND Contains(Url, 'http://dev/meeting/a-gremia-n/meetings/20102-gremia-dev/') AND ContentType = 'Agenda Item' OR ContentType = 'Meeting document')

This works fine for all our meetings where spaces occur in the url, but trouble starts when multiple hyphens are present in the url. In that case there are no search results found.

One thing we found out is that hyphen must be escaped (using a backslash), but this didn't help for all of our meeting sites.

I'm starting to wonder if the hyphen has a special meaning in the CONTAINS function, but I couldn't find any specification of it. I'm hoping someone could give us some more insight on what's going on with this query.


SharePoint Developer | @zeemanj | Blog



Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>