• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

tappedtech
#1 Posted : Friday, November 21, 2014 5:18:33 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

I'm trying to set up keyword search through the web service (/WebServices3.asmx).

My first question is should I be using Catalog_InternalProduct_StoreSearchAdvanced or Catalog_InternalProduct_FindByCriteria?

Both methods request similar information. What information is required for these methods?

I've sent requests to both methods. The token comes back without any issues (not rejected or expired) but no results are provided.

Catalog_InternalProduct_FindByCriteria returns:
...
<Catalog_InternalProduct_FindByCriteriaResponse xmlns="http://www.bvsoftware.com/Schemas/Bvc5/2006/01/WebServices3">
<Catalog_InternalProduct_FindByCriteriaResult/>
<token>...</token>
</Catalog_InternalProduct_FindByCriteriaResponse>

Catalog_InternalProduct_StoreSearchAdvanced returns:
...
<Catalog_InternalProduct_StoreSearchAdvancedResponse xmlns="http://www.bvsoftware.com/Schemas/Bvc5/2006/01/WebServices3">
<Catalog_InternalProduct_StoreSearchAdvancedResult/>
<token>...</token><rowCount>0</rowCount> //The row count returns the value I sent it (-1, 0, 100, 1000)
</Catalog_InternalProduct_StoreSearchAdvancedResponse>

Any suggestions?

Thanks!
Aaron
#2 Posted : Sunday, November 23, 2014 11:14:12 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,393
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Originally Posted by: tappedtech Go to Quoted Post
I'm trying to set up keyword search through the web service (/WebServices3.asmx).

My first question is should I be using Catalog_InternalProduct_StoreSearchAdvanced or Catalog_InternalProduct_FindByCriteria?

The short answer is that it depends what you're trying to do.

The FindByCriteria method does allow you to perform a keyword search but it's fairly simplistic. What it does under the hood is perform a SQL LIKE query against the SKU, ProductName, ShortDescription, LongDescription, MetaDescription, MetaKeywords, and Keywords fields. So, for example, if you pass it a keyword value of "road bike" it will look for that phrase. It will not perform any partial matches so a "mountain bike" product would not appear in the results.

The StoreSearchAdvanced method uses the new advanced search in BVC 2013 that uses SQL Server full-text search. You can actually tune the search algorithm via the admin (Options >> Site Settings >> Search) and weight each field differently (e.g. a match in the ProductName field is worth more than a match in the LongDescription field). This search will return more results because it performs partial matches, understands synonyms, and singular/plural forms. However, it also understands relevancy so the results are sorted by relevancy (like a search engine).

Note that the standard (i.e. non-advanced) BVC search method is not exposed via the web services API.

Originally Posted by: tappedtech Go to Quoted Post
Both methods request similar information. What information is required for these methods?

I've sent requests to both methods. The token comes back without any issues (not rejected or expired) but no results are provided.[/quote]
What properties of the ProductSearchCriteria object did you set? What about startRowIndex and maximumRows? I don't think that you will get a correct value for rowCount since this is normally passed back by reference when using the .NET code which isn't something that you can do with a web service call.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#3 Posted : Monday, November 24, 2014 5:43:44 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

Thanks, Aaron. I messed with the row variables a bit and never saw a difference in the response.

My post keeps getting denied because it's spam. So I can't provide the entire message.

I sent this:
<ProductSearchCriteria>
<Keyword>blue</Keyword>
<KeywordIsExact>false</KeywordIsExact>
<ManufacturerId></ManufacturerId>
<VendorId></VendorId>
<ParentId></ParentId>
<Status>Active</Status>
<InventoryStatus>Available</InventoryStatus>
<ProductTypeId></ProductTypeId>
<CategoryId></CategoryId>
<NotCategoryId></NotCategoryId>
<MinPrice>-1</MinPrice>
<MaxPrice>-1</MaxPrice>
<ItemsAddedInLastXDays>1000</ItemsAddedInLastXDays>
<LastXNumberOfItemsAddedToStore>1000</LastXNumberOfItemsAddedToStore>
<SortOrder>NotSet</SortOrder>
<SortBy>ProductName</SortBy>
<ChoicesAndChoiceOptions>
<Bvin></Bvin>
<ChoiceOptionName></ChoiceOptionName>
<ChoiceName></ChoiceName>
<ChoiceDisplayName></ChoiceDisplayName>
<ProductChoiceId></ProductChoiceId>
<ChoiceOptionId></ChoiceOptionId>
</ChoicesAndChoiceOptions>
<ChoicesAndChoiceOptions>
<Bvin></Bvin>
<ChoiceOptionName></ChoiceOptionName>
<ChoiceName></ChoiceName>
<ChoiceDisplayName></ChoiceDisplayName>
<ProductChoiceId></ProductChoiceId>
<ChoiceOptionId></ChoiceOptionId>
</ChoicesAndChoiceOptions>
<SpecialProductTypeOne>NotSet</SpecialProductTypeOne>
<SpecialProductTypeTwo>NotSet</SpecialProductTypeTwo>
<ExcludedSpecialProductTypeOne>NotSet</ExcludedSpecialProductTypeOne>
<ExcludedSpecialProductTypeTwo>NotSet</ExcludedSpecialProductTypeTwo>
<CustomProperties>
<PropertyBvin></PropertyBvin>
<PropertyValue></PropertyValue>
</CustomProperties>
<CustomProperties>
<PropertyBvin></PropertyBvin>
<PropertyValue></PropertyValue>
</CustomProperties>
</ProductSearchCriteria>
Aaron
#4 Posted : Monday, November 24, 2014 8:10:45 PM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,393
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Try attaching a text file of your request.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#5 Posted : Tuesday, November 25, 2014 5:50:35 AM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

Here is the text file of what I sent/received.

Thanks!
File Attachment(s):
SearchReq.txt (5kb) downloaded 1 time(s).

You cannot view/download attachments. Try to login or register.
Aaron
#6 Posted : Tuesday, November 25, 2014 9:59:52 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,393
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
I would make these changes to the criteria object that you're sending:

  • Set InventoryStatus to "NotSet"
  • Set ItemsAddedInLastXDays and LastXNumberOfItemsAddedToStore to -1
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#7 Posted : Tuesday, November 25, 2014 4:09:58 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

Hi Aaron,

I made the changes you suggested and got the same empty response back.

Any other suggestions?

Thanks!
File Attachment(s):
SearchReq2.txt (5kb) downloaded 0 time(s).

You cannot view/download attachments. Try to login or register.
Aaron
#8 Posted : Tuesday, November 25, 2014 9:00:59 PM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,393
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Have you verified that the advanced search works? To do so go to Options >> Site Settings >> Search and check the "Enable Advanced Search" checkbox. Then make sure that the fields that you want to search are checked below and that they have a weight value of at least "1". Then click the Save button. Now go to the search page of the website and perform a search. If you get results then we know that it's working.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#9 Posted : Wednesday, November 26, 2014 12:40:39 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

Hi Aaron, Advanced search isn't enabled because Full Text Search component of SQL Server is not installed. Ryan from Teeny B is going to reach out to you about getting it installed.

Would that stop Internal Product Find by Criteria from working? I tried using it with the changes you suggested and it returned the same empty response.

Thanks.
Aaron
#10 Posted : Wednesday, November 26, 2014 3:28:36 PM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,393
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Originally Posted by: tappedtech Go to Quoted Post
Would that stop Internal Product Find by Criteria from working? I tried using it with the changes you suggested and it returned the same empty response.

No, the FindByCriteria call should still work. I think the problem is that you need to explicitly set all of the parameters. Here's an example that I tested:

Code:
WebServices3.ProductSearchCriteria ps = new WebServices3.ProductSearchCriteria();
ps.CategoryId = "";
ps.InventoryStatus = WebServices3.ProductInventoryStatus.NotSet;
ps.ItemsAddedInLastXDays = -1;
ps.Keyword = "";
ps.LastXNumberOfItemsAddedToStore = -1;
ps.ManufacturerId = "";
ps.MaxPrice = -1;
ps.MinPrice = -1;
ps.NotCategoryId = "";
ps.ParentId = "";
ps.ProductTypeId = "";
ps.SortBy = WebServices3.ProductSearchCriteriaSortBy.ProductName;
ps.SortOrder = WebServices3.ProductSearchCriteriaSortOrder.Ascending;
ps.Status = WebServices3.ProductStatus.NotSet;
ps.TemplateName = "";
ps.VendorId = "";

WebServices3.Product[] products = ws.Catalog_InternalProduct_FindByCriteria(ref token, ps);
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#11 Posted : Saturday, November 29, 2014 12:56:20 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

I made sure my request matched yours and I still got an empty response back. Any other suggestions?

Also, is the WebServices3 class you used in the previous post available for me to use?

Thanks!
Aaron
#12 Posted : Monday, December 1, 2014 12:20:40 PM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,393
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
The code posted above was tested against the TeenyB site and it does return products. I'm not sure why it's not working for you.

The WebServices3 class was auto-generated by Visual Studio when I consumed the WSDL. If you're not using Visual Studio I'm sure that you can find another development tool to do something similar.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
tappedtech
#13 Posted : Monday, December 1, 2014 5:29:52 PM(UTC)
tappedtech

Rank: Member

Joined: 11/21/2014(UTC)
Posts: 66

Thanks Aaron!

Once I generated the class and set it up the way you did above, I was able to get products returned.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012