internetarchive / internetarchive/openlibrary

Triggering autocomplete with certain search terms results in Solr exceptions

Open
#3,872 1 comment 0 reactions 0 assignees View on GitHub
Lead: @cdrini Module: Solr Priority: 3 Type: Bug
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 19h
Merged PRs (30d)
138

Description

Solr throws parsing exceptions when certain search terms are typed into the search bar and autocomplete is triggered.

**Search Terms:**
`title:`
`author_name:`
`key:`

There may be other terms that will cause this. To make matters worse, if one of the above terms are followed with a double quote character, autocomplete calls will continue to fail until a closing double quote character is typed.

### Evidence / Screenshot (if possible)
![autocomplete_bug](https://user-images.githubusercontent.com/28732543/94869156-be167f80-0412-11eb-99b8-98bd9fc63275.png)

**Search terms for each request in the above screenshot are as follows:**
1. `title`
2. `title:`
3. `title:"abc`
4. `title:"abc"`

**Note:** This screenshot is from my local instance. `502` HTTP errors are returned in dev.
### Relevant url?

https://openlibrary.org/

### Steps to Reproduce

1. Navigate to any Open Library page that has a search bar.
2. Select a search facet that allows for auto-completion of search terms (either `all`, `title`, or `author`).
3. Type one of the search terms listed above.

* Actual: Autocomplete XHR call fails.
* Expected: Autocomplete XHR returns `200`, and suggested results are listed.

### Details

- **Logged in (Y/N)?** N/A
- **Browser type/version?** N/A
- **Operating system?** N/A
- **Environment (prod/dev/local)?** prod

### Proposal & Constraints

### Related files

### Stakeholders

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.