peerkar / liferay-gsearch

Google like search for Liferay 7 CE and DXP
Other
56 stars 36 forks source link

Query Builder issue #1

Closed gbovyn closed 6 years ago

gbovyn commented 6 years ago

Hi,

It seems you're using the same value for 2 different things here:

    String queryType = queryItem.getString("queryType");
    String occurString = queryItem.getString("queryType");

From the configuration available in the README it seems that occurString should get its value from the occur string? Actually it seems to always use the default value (SHOULD).

https://github.com/peerkar/liferay-gsearch/blob/master/gsearch-core-impl/src/main/java/fi/soveltia/liferay/gsearch/core/impl/query/QueryBuilderImpl.java#L144

Also the default config uses lowercase values ("occur": "must") while you try to match them with uppercase ones (if ("MUST".equals(occurString)) {). Using equalsIgnoreCase could make the check more permissive.

https://github.com/peerkar/liferay-gsearch/blob/master/gsearch-core-impl/src/main/java/fi/soveltia/liferay/gsearch/core/impl/query/QueryBuilderImpl.java#L147

peerkar commented 6 years ago

Hi @gbovyn,

Thanks a a lot for reporting! Unfortunately I won't be able to work on this project for about week from now but will take a look as soon as I can. For the second problem, could you leave a pull request?

peerkar commented 6 years ago

Hi @gbovyn,

Merged. Thanks a lot, also for pointing out the occurString! Checked and will be fixed in next commit.