pimcore / advanced-object-search Goto Github PK
View Code? Open in Web Editor NEWAdvanced Object Search community bundle provides advanced object search in Pimcore backend powered by OpenSearch.
License: Other
Advanced Object Search community bundle provides advanced object search in Pimcore backend powered by OpenSearch.
License: Other
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?
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:
getQueryPart
inside ManyToOneRelation
adapterGetting 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}
If open "Results" tab you got empty panel and error in console. https://prnt.sc/pzzig6Issue is related with removed method buildColumnConfigMenu from parent class. It's result fo PR in Pimcore repository #5093.
These BC changes aren`t present in Pimсore 6.3.0 changelog.
@fashxp I could create PR for this feature, however, this change requires adding database migration with 2 fields.
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/
Have you considered implementing this functionality based on elasticsearch queries?
challange:
paging is done on ES level, but workspace permissions are not available there
Sharing a search is now done by selecting the users, it would be nice if we are able to share the search with a role aswell.
Currently the technical name is added within brackets. The behaviour should be like in the standard data object grid
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.
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
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
Is there a plan to implement a signing handler to use Advanced Object Search with AWS ES, eg:
https://github.com/jeskew/amazon-es-php
Precondition
Steps
Like in saved column configurations of the data object 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.
Hello guys, I have a relation to supplier from CoreshopProduct. Something like that :
And from supplier I have relation to product :
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
Have you an idea about that ?
this.buildColumnConfigMenu();
is not a function.238
;Any Solutions??
I suggest to improve model and table for saved search and save ClassId in additional field. It`ll make possible to use Saved search re-usable and add permissions for saved search by Classes in Roles.
Hi, I found issue with Numeric fields. When I setup search and view results - it works fine: Ex.,
https://prnt.sc/ouggit. But after save and re-open i- It hasnt value - it
s empty. https://prnt.sc/ough2k. As result,User gets error of search: https://prnt.sc/ougimn
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
issue: #65 (comment)
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
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
.
My code :
return $this->advancedObjectSearchService->doFilter(14,
[
new FilterEntry("suppliers", "NULL")
],
"");
The error is :
"invalid filter entry for relations filter: NULL"
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?
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].
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.
When a saved search result gets opened the search result tab should be shown instead of the filter configuration.
Is it possible to add some fields to object mapping?
o_creationDate
o_modificationDate
o_published
o_type
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.
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.
I tried to filter for some data which is stored in a localized field. When the search is executed, I get the following Exception:
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.
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?
ElasticSearch too (v5 and/or v6 ?) version isn't mentionned in the documentation for the Advanced Object Search.
It seems the plugin is compatible >= v5 < 6 of ElasticSearch (according to https://github.com/ongr-io/ElasticsearchDSL#version-matrix).
But i think it should be clearly said on the requirement documentation of the plugin to help developpers.
Thanks.
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.
Hello,
In the installation section, you should specify that we need to launch
php bin/console advanced-object-search:re-index
at first to create indexes that don't exists yet.
Thanks !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.