findologic / findologic-api Goto Github PK
View Code? Open in Web Editor NEWLibrary for sending requests to the Findologic API
License: MIT License
Library for sending requests to the Findologic API
License: MIT License
Valitron
for validating submitted input by users of the library. This includes
->setUrl()
.Add URL handling for those who need it if the bug is fixed at our validation library.
Please note: This issue does not have a high priority since this bug only occurs when using the library in a bad way.
When sending navigation requests the initial parameter (the category) is set. Since this is a key feature for navigation, this parameter needs to be implemented before we can roll out our first beta version.
This parameter is the same as attrib
, except it should be setted, since you can only have one of those.
Describe the bug
The use of autocompleteBlocks for the suggest request is not possible.
How to reproduce
Steps to reproduce the behavior:
What happens
Expected behavior
A valid response is expected.
Environment details:
Additional context
Workaround:
Use the method addIndividualParam like
->addIndividualParam(
SuggestQueryParameter::AUTOCOMPLETEBLOCKS,
[BlockType::ORDERNUMBER_BLOCK],
SuggestRequest::ADD_VALUE
)
Examples should be in the README.md
and in the Wiki
@see
tags from PhpDoc.At the moment the ParameterBuilder
is taking care of config parameters and request parameters. Sine these are two entirely different things, let's separate them into their own classes.
To make the test better readable we should try to build up the expected data as a data structure and then use assertEquals
. This will also give us a nice diff view of expected and actual data when the test fails.
It probably makes more sense to rewrite the FindologicApi
to a RequestFactory, that takes care of the requests. There should be three more Objects SearchRequest
, NavigationRequest
and SuggestionRequest
. The FindologicApi
should have three methods createSerachRequest
, createNavigationRequest
and createSuggestionRequest
which will return the corresponding Objects. The objects should know their required parameters and timing info. It probably makes sense to create an abstract class for the Objects.
attrib['cat']=Jeans
. The flag may just be an indicator such as $selected
and can be getted with $filter->isSelected()
which may return true
or false
.Relevant is
*Maybe it is also useful to validate the Json from FINDOLOGIC again, but I am unsure if it makes sense or not, since FINDOLOGIC should always respond with correctly validated data. Also if the search response will be updated, a response might cause an exception since it is no longer schema conform.
For users of the library it would be great to have some Smart Did You Mean helper functions. You should be able to get the type, e.g. improved
/ corrected
and constants for it should exist in Definitions
.
getType()
: Returns the type of the query. Either improved or corrected.getOriginalQuery()
: The original query from the XML response.getAlternativeQuery()
: If it was a did you mean suggestion use the didYouMeanQuery, otherwise take the queryString.For reference take a look at:
https://github.com/findologic/plugin-shopware-unified/blob/e7bdb0be052e12bb1cc166803bc4bab94eb4a66f/FinSearchUnified/Helper/StaticHelper.php#L830
php-cs-fixer
.
autocompleteblocks
can be used to limit the number of requests autocomplete blocks. This parameter is currently not supported.
The following badges etc. need to be updated:
The timing related fields are instance variables of FindologicApi
while an instance of FindologicApi
can fire multiple requests. This is a mismatch, since the timing is related to the requests, not the FindologicApi
instance, which is basically a factory for requests.
This is probably fine for now. In the future FindologicApi
could be refactored to actually be a request factory, and then the timing info would be attached to the request class instances.
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.