I'm trying to set up my facets, like I use to do.
But this time I have some facets with Query Parameter set to a parameter of the System.Int32, and one those the Facetoptions loop is alway empty.
could use help to move on, thanks.
I'm trying to set up my facets, like I use to do.
But this time I have some facets with Query Parameter set to a parameter of the System.Int32, and one those the Facetoptions loop is alway empty.
could use help to move on, thanks.
We would love to help - but I think that requires a bit more information of your setup to be able to detect what could be the issue.
Can you post some screendumps of your setup or provide a link?
BR Nicolai
Hi Nicolai, here is my POC where I try different things on my ProductCategory Field of type Integer.
The dw version is 8.7.2.13
<p>@GetLoop("FacetGroups").Count</p>
foreach (var fg in GetLoop("FacetGroups"))
{
@fg.GetLoop("Facets").Count
foreach (var item in fg.GetLoop("Facets"))
{
<h4>@item.GetString("Facet.Name")</h4>
<select>
@foreach (var itemOption in item.GetLoop("FacetOptions"))
{
<option>@itemOption.GetString("FacetOption.Value")</option>
}
</select>
}
}
Hi Kim
Try to remove the "Stored" checkbox from the field definition.
Nicolai
Hi Nicolai,
No difference, I also tryed to take the field directly from the productfield, but its the same, no facets.
One more thing, on my query I found out that I can only use "Equal" and "Between" on Int32 and Int32[]. I have a need to use "Greater Then Or Equal" and "Less Than Or Equal". I hope you can help finding a solution on this. Thanks.
Hi Kim
I need a URL to take a closer look. Otherwise it will be "It works on my machine" answer...
You can combine an equal and greater than in a group using or.
i'll be back when i have a test environment for you to see, today or tomorrow.
Kim
Hi Nicolai, No test enviroment yet, but I found the same issue on the vine website you sent to me long time ago. The productfield "Wine Enthusiast" as int i never renderet as a facet
ok, but send me the URL to check it out once you have.
Attached my configuration and data...
yes I see your configuration, but the different is that your product customfield is a string type, try with a customfileld of type int.
- But good to see how to do it the other way around, I'm gonna need that too :)
yes but its still not the same setup as mine, because you convert it to a string and then you can't use greater than or less than I guess, and I have a need to do that.
Hi Kim
Yes - it is because how Lucene works. When you index Integers, they are not indexed on their exact value as you would read them. Lucene stores terms, and a term when dealing with nummeric values is not a number, but something else (some weird structure) so you don't get one value in the term index for each number, but something clever that Lucene can use when making range queries etc - kind of complicated to explain, but you can read more here: http://lucene.apache.org/core/4_2_0/core/org/apache/lucene/document/IntField.html.
But that means that when we apply a facet on top of this, we get some byte stuff out of the index, and that does not deserialize to something that can be shown.
So - storing the integer value as a string is the only option.
Of course our UI should probably reflect this limitation. Hope this clarifies a bit.
BR Nicolai
You must be logged in to post in the forum