Solr exclusion on stats.field? - lucene

One can tag specific filters and exclude those filters when faceting. This is generally needed when doing multi-select faceting.
Is something similar possible for the stats.field?
stats.field={!ex=foo}price // does not work
I have a price slider and I need the max price as if the price filter is not set.

Anyone concerned with this question/issue is suggested to go vote up this issue posted to the Apache Solr Jira site. (Free Apache account required.) If you are a Solr developer and wish to work on coding this feature enhancement, we salute you!

Yes.Use stats=true&stats.field=price

Related

Why is PrestaShop redirrecting to a random product when selecting variations from front-end?

I have an online shop in development, all went well until I decided to do SEO on the shop. After this, if I chose a product variation from front-end it just redirects me to a random product.
This picture describes the first state. The default product load.
This picture describes what is happening after you select a variation. As you can see the product name stays the same, but the link indicates that a totally different product is displayed.
If I have the debug mode enabled when selecting a variation it throws "An error occurred while processing your request" and in the request file I can see that besides some errors (Deprecated: array_key_exists(): Using array_key_exists()) it shows the request for a different product.
I can't understand why this is happening, so I am in dying need of your help.
That's the way Prestashop 1.7 works :
First time a customer lands in a multi-variation page, the default attribute will be loaded,
URL will show only the ID product.
Once you choose an attribute , an AJAX call will refresh the page
with the current attribute and URL will change with id_product-id_product_attribute value.
Not sure what you mean by "random product" as in both of your examples I see an attribute
being selected.
Anyway there are several (paid) modules to change this behaviour in a better SEO perspective,
this is definitely one of the most famous :
https://addons.prestashop.com/en/url-redirects/16633-pretty-urls-seo-friendly-url-remove-ids-numbers.html
EDIT: Just noticed that the ID product is different in the two screenshot, this could be related to some DB issues with attribute too, you should check if you have some not coherent values between id_product and id_product_attribute(s)
I found a fix for this. Apparently or appeared because I was using the duplicate function for uploading products. I don't know why but on some products it makes this behavior.
I've spent over 12 hours to find a explanation for this and I was unable to find one. The PrestaShop forum straight up banned me for posting this topic.
My advice is to NOT USE PRESTASHOP it's and old sistem and full of bugs, the support is expensive and I get the impression that even they don't understand their system.
If you find yourself in this situation, know this. Don't duplicate and upload products using "add new" function.
And I can't state this enough, do yourself a favour and don't use Presta, with all the expenses the time to invest and what the product looks like at the end of the road, is just a waste of time. Even after you finish is guaranteed to break in 1-2 years, any updates will break your store and you will need to invest even more more to fix it. It's an old, slow and buggy CMS. It's days are numbered.
Thanks a lot for help.
Best regards, Daniel.

How to limit access to a product to a group with time?

I'm new to Prestashop but perfectly able to modify the sources.
How could I limit access to a given product to only one given group 24 hours before the other groups ?
Thanks for answering this.
By default Prestashop does not offer this feature. You can enable or disable access for the whole group which apply for all products.
You will need to write a module your self or buy a module which does this for you.
Searching the WWW i have found this module which is free (http://store.nemops.com/free-modules/44-product-access.html) however not compatible with 1.7. With some basic PHP knowledge you can easily upgrade the module to 1.7.
You can also find multiple paid modules which does this for you (https://addons.prestashop.com/en/search?search_query=product%20access)

How to get the most searched words in Solr? [duplicate]

I'm trying to organize a solr search engine. I've already set up the misspelling system and the suggestions.
However I can't seem to find how to retrieve the top 10 most searched words/terms/keywords in solr/lucene. How can I get this? I want to display those on my homepage.
Solr does not provide this kind of feature out of the box. There is the StatsComponent, that provides you with all kind of statistics, but all of those are numeric only.
Depending on how you access solr (directly or via your own app) you could intercept all calls an log the query string. I did this in a recent project where I logged a queries to a database. If you submit all keywords to an other core on your solr server, you can faceting queries on your search terms as described by Hyque
You could use a facet for retrieving the Top X words like this:
http://yourservergoeshere/solr/select?q=*&wt=xml&indent=true&facet=true&facet.query=*&facet.field=message&facet.limit=10&facet.minCount=1
The value of facet.field depends on the field you like to search in. With facet.limit you'll (obviously) limit the amount of results to 10. You'll find the facet results at the end of the results, starting with "facet_counts"
Edit: I really should go to bed earlier. I didn't see the "most searched" in your question. Sorry for that.
Apache Solr does not provide any such capability as of today. There is a desire for this and a JIRA ticket corresponding to it. You can vote for it if you'd like to see it in Solr some day: https://issues.apache.org/jira/browse/SOLR-10359.
The stats component provides information around statistics, but it's mostly numeric in nature. You could parse server logs and come up with a way to build a Frequently Searched Terms (e.g. pump those logs in SiLK or Kibana for visualization).
If you have the ability to change the front end and add some javascript code to the UI or can intercept the search request and make an async or batch calls to APIs for tracking, you can use SearchStax Analytics that provides Search Analytics that tracks searches, clicks, cart actions, revenue, etc.

How to add new field tab in prestashop product backoffice?

I want to add new field in prestashop product backoffice . This tab is same description tab.Please find attached screenshot what I need .
Thanks
Prestashop overrides their core (all their code files) every time you use the one-click-update in order to prevent developers to mess with their core.
Any modification on this page will be overridden on your next update unless you are willing to update the files manually with FTP and the database via PHPMyAdmin (or with MySQL workbench via remote connection) without overriding anything related to this interface.
I strongly advise you against this as you'll most certainly face incompatibility between your version and Prestashop core pretty quickly.
If you think your request is good for the whole community, you might try to pull a suggestion here: http://forge.prestashop.com/secure/Dashboard.jspa
Do not put to much hope on this as Prestashop team is quite busy.
If it's something specific to your shop, you'll need to hire a freelancer to as suggested by Raghubendra Singh in his comment. I'll add to his comment that it will need to be in a custom module. You might try to pull a proposal on this website: https://www.upwork.com/
If you do so, make sure that the developer you hire have a good experience both with PHP/MySQL and Prestashop itself (as it is a complex system). Even if you hire a developer from Filipino or India, you'll probably need to invest at least a thousand US dollars in order to have something sharp.
Also, please note that you'll need to hire the developer once more at least for every major update (by example 1.7.X => 1.8.X) to fix the incompatibility with Prestashop core.
the simplest way is to use an addon. For instance, this one.
It allows adding an unlimited number of tabs, some of them have a predefined structure (contact form or attachments). Others are changeable. So it's possible to add any content you need: additional pictures, video, text, etc.

Drupal 7 Commerce Search API

I would like to create a searchbox like the standard one in Drupal but for Drupal Commerce (1.4). I did not use a product display, but all my products are created.
Is there a way to accomplish this?
I found this: http://drupal.org/project/commerce_search_api
and this: http://commerceguys.com/blog/commerce-module-tuesday-commerce-search-api (funny english :-) )
I've tried the second one, but I don't need a price ruler. I just want to give the visitor the possibility to search through my products. Not only the title field, but also the description field and if possible the taxonomy terms. It didn't work anyway.
Need help! Thx!
I thought to create this with views, but all good suggestions are welcome.
You could disable the Search API modules and simply use the default Search module provided by Drupal, this would enable searching through nodes, users, etc as usual.
The Search API may be over kill for what you want, unless you have a good mix of variations, prices, product attributes, etc that you would like users to use as search filters (price range, per attribute, etc).