Developer forum

Forum » Dynamicweb 10 » Assigning a product to a datamodel doesn't register index rebuild request

Assigning a product to a datamodel doesn't register index rebuild request

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

When you assign a product to a data model, no Index Rebuild request is registered and the changed product is not updated in the index. That means that queries won't pick this up until you save the product or rebuild the index. Can that be fixed?

Steps to repro:

  1. Set up a query as described here: https://doc.dynamicweb.dev/manual/tutorials/intro/product-enrichment.html#all-products-not-related-to-a-category
  2. Confirm you have some products in the query
  3. Edit a product and assign it to a data model you set up the query for in step 1 and save
  4. Refresh the query.

Expected results
The product you changed in step 3 should disappear as it's now assigned to a category.

Actual results
The product you changed in step 3 is still there. It only disappears after you edit and save the product, or rebuild the backend index.

Imar


Replies

 
Lars Holm Byg Dynamicweb Employee
Lars Holm Byg
Reply

Hi Imar
What versions are you having the issue on? 

I replicated in on 10.14

But not on 10.15, so seems solves there. All needed there is a refresh in browser after the action is made. 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Lars,

Just upgraded to 10.15 and I am still seeing the same thing. See attached video that shows the following:

1. Create new query using these steps: https://doc.dynamicweb.dev/manual/tutorials/intro/product-enrichment.html#all-products-not-related-to-a-category

2. Confirm that the query is showing products

3. Confirm that the ID of the Categories2 model is SHOP29

4. Modifying a product by assigning it a value under the Categories2 model

5. Rerunning the query showing that the product is still there and tied to the correct model

If I rebuild the Products Backend index, the product does disappear from the query results as expected.

Am I missing something?

Imar

 

Query.gif
 
Lars Holm Byg Dynamicweb Employee
Lars Holm Byg
Reply

Hi Imar

Running 10.15.1 

I have experienced I needed to refresh (F5) in the browser. 

Can't seem to find where we are doing things differently. 

See my screen rec for reference. 

 

But i do get some strange results, when then deleting a the data model again, then it should re-apear in the query, but it don't

 
Lars Holm Byg Dynamicweb Employee
Lars Holm Byg
Reply
This post has been marked as an answer

Hi Imar

Could you check is your "Autobuild index on product update" is checked on the Shop. 

And check if the index on your query is using the same index as the the one on the shop. 

If that is not the case that could mean we are experiencing different behaviour. 

But it does seem that there is an issue when deleting the data model from the product, as that does not trigger an index update. 

 

 

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

>> Could you check is your "Autobuild index on product update" is checked on the Shop. 

Oh, that was it! Thanks!

Once I changed it to the products backend index, it started to work. I never looked at the Advanced tab, and it also wasn't mentioned in the steps of this tutorial: https://doc.dynamicweb.dev/manual/tutorials/intro/product-structure-attributes.html#part-4-data-modeling. Would be nice it was added there.

Note: deletion does work for me and the results are reflected in the query immediately. Maybe this was fixed in a very recent version? I updated today using NuGet.

Cheers,

Imar

 
Dynamicweb Employee
Carsten Boll
Reply

Hi Imar, it's actually mentioned in the previous tutorial which the attributes and data model builds on. But I agree that it's easy to miss, so I'll add a reminder in the tutorial you reference :)

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Thanks Carsten!

 
Dynamicweb Employee
Carsten Boll
Reply

Added the change today - btw, if you're using these tutorials you should be aware that I will be moving them to the developer-documentation the next time we release the docsite. The will be located under the implementing section, as a part of a larger restructure with increased focus on implementer docs.

 

You must be logged in to post in the forum