Developer forum

Forum » Ecommerce - Standard features » Repository search query

Repository search query

Andreas Pettersson
Reply

Hi,

I have a product search query where I have a parameter in. But it seems that if i search for a space value like: TE 1000 it splits on the space and do one search for TE and another one for 1000. But i want so it search for the whole value, so any tips how it search for the whole TE 1000 value in this case and not split them up as it looks like now?

 

 

Freetext field is a combination of these fields:

 

The productname sort does not seem to work. "Betongbask" should be over "Slampump in my opinion.


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Andreas,

 

You need to create an index field that is NOT Analyzed and then use a "ContainsExtended" to achieve that. Depending on the field it may already exist (i.e. Name for Sort). The performance could be affected if you are doing that in fields such as Description or Teaser text.

 

But test your scenarios. You may run into a catch-22 trying to setup for searches that work with this scenario, while keeping the current functionality.

 

Best Regards,

Nuno Aguiar

 
Andreas Pettersson
Reply

Hi,
Thank you for the answer.

Is the Product name (sort) a standard field in DW thats not analyzed?

Now I set it up like this, but it does not seem to work: 

I rerun the index for product after saving this.

And removed field "Product name" from my custom field "FreetextSearch"

 

Do i need to set all my expression fields to not anaylzed? 

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Andreas,

 

What do you mean by "does not work"? Is the product not found or are the other products still found? Have you tried disabling the other expressions associated with the 'q' parameter?

 

If it helps, "Analyzed" will take the value of a field and split into individual terms (let's say 'words' for simplicity sake) and you'll get an array strings. And the Contain operator (in Lucene world) is a "starts with" of each of those terms. Analyzed fields are extremely important for faceting/filtering and free text search. Hope that helps paint the picture.

 

BR

Nuno

 
Andreas Pettersson
Reply

Hi,

I don't get any product.

Now i tried like this and search for TE 1000 but I don't get any product even that productname is this: Bilningshammare, eldriven, 14 kg TE 1000:

 

Regards
Andreas

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Andreas,

 

I guess you'd have to look into the index to see.

  • Download the index files from File Manager > System > Indexes > Products (your repo name) > (one of the instances)
  • Use a Lucene reader such as LukeNet to open the repo (attached)
  • Find the document (that product) and inspect the property Name by right-clicking and seeing what's indexed
  • It should look sort of like this. 
 
Andreas Pettersson
Reply

Hi,
Thank you. 
I will look.

Mine look like this:


Regards
Andreas

 

You must be logged in to post in the forum