Git Product home page Git Product logo

advanced-object-search's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

advanced-object-search's Issues

Horizontal scroll while building queries

Hi,

When we are building search queries (conditions/groups) it sometimes happens that the screen width is to small. The operator or value fields fall off the window and it's not possible to use a horizontal scroll.

Is it possible to enable the horizontal scrolling?

Many to many relation for variants

In the ManyToOne field definition adapter searches for object_ids are always added for the type 'object'. In some of our projects we also use variants and the type property in Elastic is set to 'variant' instead of 'object' which results in an empty search.

2 possible changes that can be made:

  1. Change the index task to set the type always to 'object' (ofcourse for objects...)
  2. Add 'variant' search as well in the getQueryPartinside ManyToOneRelation adapter

Elastic 7 error when rebuilding class

Getting error while running classes-rebuild command or saving classes

  [Elasticsearch\Common\Exceptions\BadRequest400Exception (400)]                                                                                                                                           
  {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."}],"type":"illegal_argu  
  ment_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."},"status":400}  

Request URL too Long

After updating to latest pimcore I am getting Request too long error in Advanced object search.
image

Error on publish checkbox click

After click I got error : http://prntscr.com/mie9t7

Timestamp: Fri Feb 08 2019 17:03:22 GMT+0300 (Москва, стандартное время)
Status: 500 | Internal Server Error
URL: /admin/bundle/advanced-object-search/admin/grid-proxy?classId=1&xaction=update&_dc=1549634602145
Method: POST
Message: The _controller value "PimcoreAdminBundle:Admin\DataObject:gridProxy" maps to a "Pimcore\Bundle\AdminBundle\Controller\Admin\DataObjectController" class, but this class was not found. Create this class or check the spelling of the class and its namespace.

Issue is related with path /admin/grid-proxy added after /admin/bundle/advanced-object-search/

Call to a member function getAllowInherit() on null

I'm getting the following error when trying to add a condition in the search configurator.

Timestamp: Tue Jan 15 2019 10:29:51 GMT+0100 (centraleuropeisk normaltid)
Status: 500 | Internal Server Error
URL: /admin/bundle/advanced-object-search/admin/get-fields?_dc=1547544589822
Method: GET
Message: Call to a member function getAllowInherit() on null

The error happens in AdvancedObjectSearchBundle\Controller\AdminController because of these lines

$classId = intval($request->get("class_id"));
$definition = DataObject\ClassDefinition::getById($classId);
$allowInheritance = $definition->getAllowInherit();

All my classes have been created with string ids instead of a number. Because of this the intval(...) won't work.
Example: I have a class named Client with the id client. intval('client') returns 0 which in turn leads to no ClassDefintion being found.

ElasticSearch 7.x support

Hello,

Is there a planned version of this plugin supporting ElasticSearch 7.x ?
I have this error with the mapping creation console command :

  {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."}],"type":"illegal_argument_exception","reason":"Types cannot be provided in put mapping r
  equests, unless the include_type_name parameter is set to true."},"status":400}

Best regards,
Fred

Error while Saving/Updating Object due to Length

While trying to update or save the object I am getting following error:

[DEBUG][o.e.a.b.TransportShardBulkAction] [b-cA5Xc] [object_scholarship][4] failed to execute bulk item (index) BulkShardRequest [[object_scholarship][4]] containing [index {[object_scholarship][Scholarship][115741], source[n/a, actual length: [73.1kb], max length: 2kb]}] java.lang.IllegalArgumentException: Document contains at least one immense term in field="availableZipCodes.raw" (whose UTF8 encoding is longer than the max length 32766), all of which were skipped. Please correct the analyzer to not produce such terms. The prefix of the first immense term is: '[54, 48, 48, 48, 49, 44, 54, 48, 48, 48, 50, 44, 54, 48, 48, 48, 52, 44, 54, 48, 48, 48, 53, 44, 54, 48, 48, 48, 54, 44]...', original message: bytes can be at most 32766 in length; got 72149 at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:806) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:447) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:403) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:273) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:433) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1384) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.apache.lucene.index.IndexWriter.addDocuments(IndexWriter.java:1360) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:661) ~[elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.index.engine.InternalEngine.indexIntoLucene(InternalEngine.java:607) ~[elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:505) ~[elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:556) ~[elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:545) ~[elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.bulk.TransportShardBulkAction.executeIndexRequestOnPrimary(TransportShardBulkAction.java:491) ~[elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.bulk.TransportShardBulkAction.executeBulkItemRequest(TransportShardBulkAction.java:146) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:115) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:70) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryShardReference.perform(TransportReplicationAction.java:939) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryShardReference.perform(TransportReplicationAction.java:908) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.ReplicationOperation.execute(ReplicationOperation.java:113) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$AsyncPrimaryAction.onResponse(TransportReplicationAction.java:322) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$AsyncPrimaryAction.onResponse(TransportReplicationAction.java:264) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$1.onResponse(TransportReplicationAction.java:888) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$1.onResponse(TransportReplicationAction.java:885) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.index.shard.IndexShardOperationsLock.acquire(IndexShardOperationsLock.java:151) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.index.shard.IndexShard.acquirePrimaryOperationLock(IndexShard.java:1657) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction.acquirePrimaryShardReference(TransportReplicationAction.java:897) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction.access$400(TransportReplicationAction.java:93) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$AsyncPrimaryAction.doRun(TransportReplicationAction.java:281) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:260) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:252) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.transport.TransportService$7.doRun(TransportService.java:644) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638) [elasticsearch-5.5.3.jar:5.5.3] at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.5.3.jar:5.5.3] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171] Caused by: org.apache.lucene.util.BytesRefHash$MaxBytesLengthExceededException: bytes can be at most 32766 in length; got 72149 at org.apache.lucene.util.BytesRefHash.add(BytesRefHash.java:263) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.apache.lucene.index.TermsHashPerField.add(TermsHashPerField.java:149) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:796) ~[lucene-core-6.6.0.jar:6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:29:46] ... 37 more

Operators in results grid

In the results grid it's possible to change the column configuration. The operators that can be selected/added do work the first time, but when you reopen the column configuration there is a blank column instead and loses it's configuration.

Get object relation with properties

Hello guys, I have a relation to supplier from CoreshopProduct. Something like that :
Screenshot from 2019-07-12 17-49-44

And from supplier I have relation to product :
Screenshot from 2019-07-12 17-51-07

But when I trying to get products like this :

eturn $this->advancedObjectSearchService->doFilter(14,
                [
                    new FilterEntry(
                        "categories",
                        [
                            "type" => "object",
                            "id" => $category->getId()
                        ],
                        BoolQuery::SHOULD
                    )
                ],
                ""
            );

I don't have all properties of supplier like : name, city, etc. I have only the id
Screenshot from 2019-07-12 17-53-23

Have you an idea about that ?

Is not a function in resultpanel.js.

  • I am getting Error while generating results on console as
    this.buildColumnConfigMenu(); is not a function.
    In resultPanel.js at line no 238;

Any Solutions??

Feature request: config should follow symfony/pimcore rules for dev/prod

Currently, the advanced-object-search only read the config from "config.php".

Ist should detect and read (if given) the config files in conjunction with the enviroment (dev/prod).
This is usefull, to define different elasticsearch instances for dev and prod for example.

config_dev.php
config_prod.php
config.php

Error on add columns in Grid Options

After open "Grid Options" I got exception http://prntscr.com/mie86c:

Timestamp: Fri Feb 08 2019 16:56:24 GMT+0300 (Москва, стандартное время) Status: 500 | Internal Server Error URL: /admin/object/grid-proxy?classId=undefined&folderId=undefined Method: POST Message: Call to a member function getName() on null

Might it be related with undefined values for classId and folderId

Get only product whitout variants

Hello, I tried to get only product whitout variants, but I have a error. In my case a product that is not variant has suppliers = NULL.
Screenshot from 2019-07-18 14-26-16

My code :

 return $this->advancedObjectSearchService->doFilter(14,
            [
                new FilterEntry("suppliers", "NULL")
            ],
            "");

The error is :

"invalid filter entry for relations filter: NULL"

Feature Request: Block Indexing

Hey there, thank you for the amazing plugin. I am planning on using it on a current project :)
I would like to be able to search for objects based on data contained in Block. for my specific use case; I have Blocks which contain a handful of fields, with information and certifications, and product SKU numbers. There are usually 10 of these blocks or so, on each object. I am certain that customers will come to the site searching for their specific SKU instead of the more generic product number.

Example data structure:
in this structure the skus are blocks containing text input fields.
{ "productNumber": "T1X50", "skus": [ { "sku": "T1X50-US", "countries": "US,CA,MX", "MSRP": "1526.00", "channel": "Rinco" }, { "sku": "T1X50-BR", "countries": "BR", "MSRP": "1226.00", "channel": "PaoCa" }] }

Is it reasonable to ask for this feature? And if not, what can I do to help out getting this feature implemented?

Bug in Service.php --> Release new version

Hey,

I just came across this already fixed bug d23b979#diff-16a921c287a57770d0ab59c0fb771b5d in the Service.php doFilter() function and wanted to report it.

As it's already fixed, can you please release it as a new version so I can update via composer?

Thanks :-)

PS: Any plans on moving to ElasticSearch 6? Right now it doesn't work with ES6 since it uses different types for e.g. a textfield [string vs. text].

Custom mapping

Hi,

I would like to know of custom object mapping is possible? I like to use the same schema that is being used by VUE JS storefront.

Filter on objectbrick not working

After upgrading Pimcore from 5.2 to 5.6 we can no longer create conditions containing object bricks. Advanced object search is version 1.8.0.

First we select the object brick field.
Then we select the object brick type. In this step we get the following js-error:

Uncaught TypeError: Cannot read property 'fieldname' of null
    at klass.<anonymous> (fieldcollections.js:99)
    at E.fire (ext-all.js:22)
    at E.doFireEvent (ext-all.js:22)
    at E.a.doFireEvent (ext-all.js:22)
    at E.fireEventArgs (ext-all.js:22)
    at E.fireEvent (ext-all.js:22)
    at E.onProxyLoad (ext-all.js:22)
    at E.triggerCallbacks (ext-all.js:22)
    at E.setCompleted (ext-all.js:22)
    at E.setSuccessful (ext-all.js:22)

The dropdown with fields from the object brick is populated but selecting a field gives another js-error:

Uncaught TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at klass.getConditionPanel (quantityValue.js?_dc=1554795940:25)
    at klass.<anonymous> (fieldcollections.js?_dc=1554795940:139)
    at E.fire (ext-all.js?_dc=105b8cfa4ceb7545017adf73980de722d0033eb2:22)
    at E.doFireEvent (ext-all.js?_dc=105b8cfa4ceb7545017adf73980de722d0033eb2:22)
    at E.doFireEvent (ext-all.js?_dc=105b8cfa4ceb7545017adf73980de722d0033eb2:22)
    at E.a.doFireEvent (ext-all.js?_dc=105b8cfa4ceb7545017adf73980de722d0033eb2:22)
    at E.fireEventArgs (ext-all.js?_dc=105b8cfa4ceb7545017adf73980de722d0033eb2:22)
    at E.fireEvent (ext-all.js?_dc=105b8cfa4ceb7545017adf73980de722d0033eb2:22)
    at E.checkChange (ext-all.js?_dc=105b8cfa4ceb7545017adf73980de722d0033eb2:22)

After this we do not get any further.

Increase default index total_fields limit

The default limit of elasticsearch is 1000. Sometimes that's not enough and as side effects very strange things could happen. Therefore the default limit should be increased.

Filter on localized fields not working

I tried to filter for some data which is stored in a localized field. When the search is executed, I get the following Exception:

grafik

This is my filter configuration:

$filters = [
	[
		"fieldname" => "visibleInWeb",
		"filterEntryData" => true,
		"operator" => BoolQuery::MUST,
	],
	[
		"fieldname" => "o_published",
		"filterEntryData" => true,
		"operator" => BoolQuery::MUST,
	],
	[
		"fieldname" => "localizedfields",
		"filterEntryData" => [
			"de" => [
				"searchName" => "test123"
			]
		]
	]
];

$results = $service->doFilter("pimproduct",
	$filters,
	"",
	$offset,
	$articlePerPage
);

It seems that the search term "test123" is threated as separate filter configuration in vendor\pimcore\advanced-object-search\src\Service.php:643. Because it's only a string, an Exception is thrown.

Deprecation warning: accessing private service from container in Symfony 3.4.*

Pimcore version: "pimcore/core-version": "v5.1.2"
Symfony version: "symfony/symfony": "3.4.*"

Hi, when running the re-index command I see the following deprecation warning:

User Deprecated: The "bundle.advanced_object_search.filter.default" service is private, getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. You should either make the service public, or stop using the container directly and use dependency injection instead.

This is due to services being private by default since Symfony 3.4 (see https://symfony.com/blog/new-in-symfony-3-4-services-are-private-by-default) and it is recommended to either make it public (possible code smell) or inject it.

The affected lines are for instance in AdvancedObjectSearchBundle\Service line 86ff.

public function getFieldDefinitionAdapter(ClassDefinition\Data $fieldDefinition, bool $considerInheritance) {
        $adapter = null;

        try {
            $adapter = $this->container->get("bundle.advanced_object_search.filter." . $fieldDefinition->fieldtype);
        } catch (\Exception $exception) {
            $adapter = $this->container->get("bundle.advanced_object_search.filter.default");
        }

        $adapter->setConsiderInheritance($considerInheritance);
        $adapter->setFieldDefinition($fieldDefinition);

        return $adapter;
    }

Probably not desired to inject all Filters here, so maybe make the services public?

Error when getting object by id

Hello,
I tried to get an object by id but I get an error :
My code :

$results = $service->doFilter(17,
            [
                new FilterEntry(
                    "objects",
                    [
                        "type" => "object",
                        "id" => 75
                    ],
                    BoolQuery::SHOULD
                )
            ],
            ""
        );

The error :

 Type error: Argument 1 passed to AdvancedObjectSearchBundle\Service::getFieldDefinitionAdapter() must be an instance of Pimcore\Model\DataObject\ClassDefinition\Data, boolean given

Have you an idea about that ? thx in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.