|
Home > Archive > Commerce Server Catalog > July 2006 > Help searching over multiple categories
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Help searching over multiple categories
|
|
|
| I'm trying to search for a product that exists in 2 different categories with
no success. Is it possible to do such a search?
I'm using the following CategoriesClause:
catalogSearch.CategoriesClause = CatalogItemsDataSetSchema.CategoryName +
"'=books AND " + CatalogItemsDataSetSchema.CategoryName + "=pirates";
This returns no results even though the product is in both the 'books'
category and the 'pirates' category.
If I use an 'OR' or an 'IN ('books','pirates')' instead of the 'AND'
operator I get the expected results. Does the 'AND' clause not work in the
CategoriesClause or is there another way of doing this?
| |
| Vinayak Tadas[MSFT] 2006-07-21, 1:20 am |
| The categories clause is used to determine which categories to perform the
search on
If you have a condition CategoryName = foo and CategoryName=bar then this
will not result in any searchable categories becuase a category cannot have
both foo and bar as the name
As you found out you need to use either OR or the IN operator
Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Get Secure! For more info visit http://www.microsoft.com/security. Please
reply to the newsgroups only
--------------------
Thread-Topic: Help searching over multiple categories
thread-index: AcarfouiBQWepm7iSImlmNy0tcJU0Q==
X-WBNR-Posting-Host: 66.43.16.199
From: =?Utf-8?B?Z3JlZw==?= <greg@discussions.microsoft.com>
Subject: Help searching over multiple categories
Date: Wed, 19 Jul 2006 14:59:02 -0700
Lines: 14
Message-ID: <C911B3D6-EDD8-438C-8F29-096A575994AE@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Newsgroups: microsoft.public.commerceserver.catalog
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.catalog:6180
NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250
X-Tomcat-NG: microsoft.public.commerceserver.catalog
I'm trying to search for a product that exists in 2 different categories
with
no success. Is it possible to do such a search?
I'm using the following CategoriesClause:
catalogSearch.CategoriesClause = CatalogItemsDataSetSchema.CategoryName +
"'=books AND " + CatalogItemsDataSetSchema.CategoryName + "=pirates";
This returns no results even though the product is in both the 'books'
category and the 'pirates' category.
If I use an 'OR' or an 'IN ('books','pirates')' instead of the 'AND'
operator I get the expected results. Does the 'AND' clause not work in the
CategoriesClause or is there another way of doing this?
| |
|
| A category cannot have both 'foo' and 'bar' as the name BUT a product can
belong to both categories 'foo' and 'bar'. So the question is, is there a way
to return only the product that belong to both categories 'foo' and 'bar'?
""Vinayak Tadas[MSFT]"" wrote:
> The categories clause is used to determine which categories to perform the
> search on
> If you have a condition CategoryName = foo and CategoryName=bar then this
> will not result in any searchable categories becuase a category cannot have
> both foo and bar as the name
> As you found out you need to use either OR or the IN operator
>
> Thanks
> Vinayak Tadas
> Microsoft
> http://blogs.msdn.com/vinayakt
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All rights
> reserved.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> Get Secure! For more info visit http://www.microsoft.com/security. Please
> reply to the newsgroups only
>
>
> --------------------
> Thread-Topic: Help searching over multiple categories
> thread-index: AcarfouiBQWepm7iSImlmNy0tcJU0Q==
> X-WBNR-Posting-Host: 66.43.16.199
> From: =?Utf-8?B?Z3JlZw==?= <greg@discussions.microsoft.com>
> Subject: Help searching over multiple categories
> Date: Wed, 19 Jul 2006 14:59:02 -0700
> Lines: 14
> Message-ID: <C911B3D6-EDD8-438C-8F29-096A575994AE@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
> Newsgroups: microsoft.public.commerceserver.catalog
> Path: TK2MSFTNGXA01.phx.gbl
> Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.catalog:6180
> NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250
> X-Tomcat-NG: microsoft.public.commerceserver.catalog
>
> I'm trying to search for a product that exists in 2 different categories
> with
> no success. Is it possible to do such a search?
>
> I'm using the following CategoriesClause:
>
> catalogSearch.CategoriesClause = CatalogItemsDataSetSchema.CategoryName +
> "'=books AND " + CatalogItemsDataSetSchema.CategoryName + "=pirates";
>
> This returns no results even though the product is in both the 'books'
> category and the 'pirates' category.
>
> If I use an 'OR' or an 'IN ('books','pirates')' instead of the 'AND'
> operator I get the expected results. Does the 'AND' clause not work in the
> CategoriesClause or is there another way of doing this?
>
| |
| Vinayak Tadas[MSFT] 2006-07-22, 1:18 am |
| The current search will return products which exist in either one of the
categories.
It is basically a Union not an intersection
Thanks
Vinayak Tadas
Microsoft
http://blogs.msdn.com/vinayakt
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Get Secure! For more info visit http://www.microsoft.com/security. Please
reply to the newsgroups only
--------------------
Thread-Topic: Help searching over multiple categories
thread-index: AcasR7YEzONGTzAtS2SEY6/2v/O7NQ==
X-WBNR-Posting-Host: 66.43.16.199
From: =?Utf-8?B?Z3JlZw==?= <greg@discussions.microsoft.com>
References: <C911B3D6-EDD8-438C-8F29-096A575994AE@microsoft.com>
<zCkyxPErGHA.4612@TK2MSFTNGXA01.phx.gbl>
Subject: RE: Help searching over multiple categories
Date: Thu, 20 Jul 2006 14:59:02 -0700
Lines: 67
Message-ID: <6E6407DE-FE3C-4421-A522-2CFD61C5582B@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 8bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Newsgroups: microsoft.public.commerceserver.catalog
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.catalog:6191
NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250
X-Tomcat-NG: microsoft.public.commerceserver.catalog
A category cannot have both 'foo' and 'bar' as the name BUT a product can
belong to both categories 'foo' and 'bar'. So the question is, is there a
way
to return only the product that belong to both categories 'foo' and 'bar'?
""Vinayak Tadas[MSFT]"" wrote:
> The categories clause is used to determine which categories to perform
the
> search on
> If you have a condition CategoryName = foo and CategoryName=bar then this
> will not result in any searchable categories becuase a category cannot
have
> both foo and bar as the name
> As you found out you need to use either OR or the IN operator
>
> Thanks
> Vinayak Tadas
> Microsoft
> http://blogs.msdn.com/vinayakt
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All
rights
> reserved.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> Get Secure! For more info visit http://www.microsoft.com/security.
Please
> reply to the newsgroups only
>
>
> --------------------
> Thread-Topic: Help searching over multiple categories
> thread-index: AcarfouiBQWepm7iSImlmNy0tcJU0Q==
> X-WBNR-Posting-Host: 66.43.16.199
> From: =?Utf-8?B?Z3JlZw==?= <greg@discussions.microsoft.com>
> Subject: Help searching over multiple categories
> Date: Wed, 19 Jul 2006 14:59:02 -0700
> Lines: 14
> Message-ID: <C911B3D6-EDD8-438C-8F29-096A575994AE@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
> Newsgroups: microsoft.public.commerceserver.catalog
> Path: TK2MSFTNGXA01.phx.gbl
> Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.catalog:6180
> NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250
> X-Tomcat-NG: microsoft.public.commerceserver.catalog
>
> I'm trying to search for a product that exists in 2 different categories
> with
> no success. Is it possible to do such a search?
>
> I'm using the following CategoriesClause:
>
> catalogSearch.CategoriesClause = CatalogItemsDataSetSchema.CategoryName +
> "'=books AND " + CatalogItemsDataSetSchema.CategoryName + "=pirates";
>
> This returns no results even though the product is in both the 'books'
> category and the 'pirates' category.
>
> If I use an 'OR' or an 'IN ('books','pirates')' instead of the 'AND'
> operator I get the expected results. Does the 'AND' clause not work in
the
> CategoriesClause or is there another way of doing this?
>
|
|
|
|
|