Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST request with items containing _ (underscore) returns unexpected results #10

Closed
earthquakesan opened this issue Nov 28, 2016 · 1 comment
Assignees
Labels

Comments

@earthquakesan
Copy link
Contributor

POST request for getting document frequencies using public endpoint at:
http://palmetto.aksw.org/palmetto-webapp/service/df
Returns unexpected number of results if one of the items (words) in a query contains underscore (_) character. For example this query works as expected:

http://palmetto.aksw.org/palmetto-webapp/service/df?words=cat

However this query fails:

http://palmetto.aksw.org/palmetto-webapp/service/df?words=cat_

The same for the complex terms such as:

http://palmetto.aksw.org/palmetto-webapp/service/df?words=foundation_year

Expected results would be an empty set. That is if query contains no data, first 4 bytes should be empty. Right now, if query contains a term like this somewhere in the middle, e.g.:

http://palmetto.aksw.org/palmetto-webapp/service/df?words=cat%20foundation_year%20dog

It will return two results, one for cat and one for dog, but the middle term would be ignored completely. As it is right now such cases requires special parsing, which should not be the case.

@MichaelRoeder MichaelRoeder self-assigned this Nov 28, 2016
MichaelRoeder added a commit that referenced this issue Nov 28, 2016
… statement to the df method to increase the speed for words that haven't been found at all.
MichaelRoeder added a commit that referenced this issue Nov 28, 2016
@MichaelRoeder
Copy link
Member

The problem seems to be caused by the Spring framework. A local JUnit test works fine while a call to the online service does not work as expected. Thus, the default handling of method parameters of Spring seems to remove words containing an underscore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants