How do you search against a managed property in MOSS that is setup as a date using the querystring parameters?
I have setup a custom managed property in MOSS and mapped it to a crawled property.
The managed property is a date.
How can I search "Earlier than this date" in the query string.
This does not seem to work, so does anybody know what does?
...Results.aspx?k=thekeywords&createddate=<10/10/2010
I开发者_StackOverflow'd want to bring back results where the custom managed property called "createddate" holds a value that is a date earlier than 10/10/2010
What is the correct way to format this in my query string?
Dan, I looked at this a little bit and it looks like you're talking about the webparts on the search results page? If so, this question is really around how to configure the webparts on that page (rather than a programming question).
First, the URL doesn't work quite the way you describe. A query string is used to pass parameters to the page. The webparts on the page then read the URL parameters. The parameters are always set using =
so your variables above would be:
- k is
thekeywords
- createddate is
<10/10/2010
Note the <
is included in the value. I think you'll probably end up with ...Results.aspx?k=thekeywords&createddate=10/10/2010
and then you'll configure it later in a webpart to use a <= to compare.
Second, I'm confused as to why you created a new metadata property? Created
(a datetime) already exists.
Third, I don't think the out of the box web parts are going to be able to do what you want (a <= on a custom datetime metadata property). I'm thinking you'll want to write your own custom webpart that uses FullTextSQLQuery.
精彩评论