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

Uncaught exception when searching includes " #9482

Open
1 of 2 tasks
teertinker opened this issue Dec 19, 2022 · 5 comments
Open
1 of 2 tasks

Uncaught exception when searching includes " #9482

teertinker opened this issue Dec 19, 2022 · 5 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs search
Milestone

Comments

@teertinker
Copy link
Contributor

teertinker commented Dec 19, 2022

JabRef version

5.8 (latest release)

Operating system

GNU / Linux

Details on version and operating system

Ubuntu 21.04

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

Enter a search term including: "soziale Arbeit"
--> the problem does not occur in every situation. It could be caused by the space between the two words.
image

Appendix

...

Log File
Index path for /home/felix/Dokumente/UniDaten/backup/Jena.bib is /home/felix/.local/share/JabRef/lucene94
Could not parse query: '"bi'!
Cannot parse '"bi': Lexical error at line 1, column 4.  Encountered: <EOF> after : "\"bi"
Index path for /home/felix/Dokumente/UniDaten/backup/Jena.bib is /home/felix/.local/share/JabRef/lucene94
Could not parse query: '"b'!
Cannot parse '"b': Lexical error at line 1, column 3.  Encountered: <EOF> after : "\"b"
Index path for /home/felix/Dokumente/UniDaten/backup/Jena.bib is /home/felix/.local/share/JabRef/lucene94
Index path for /home/felix/Dokumente/UniDaten/backup/Jena.bib is /home/felix/.local/share/JabRef/lucene94
Could not parse query: 'biermann"'!
Cannot parse 'biermann"': Lexical error at line 1, column 10.  Encountered: <EOF> after : ""

Uncaught exception occurred in Thread[JavaFX Application Thread,5,main]
java.lang.IllegalStateException: field "path" was indexed without position data; cannot run PhraseQuery (phrase=path:"sozial arbeit")
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.PhraseQuery$1.getPhraseMatcher(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.PhraseWeight.scorer(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.Weight.scorerSupplier(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.BooleanWeight.scorerSupplier(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.BooleanWeight.scorer(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.Weight.bulkScorer(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.BooleanWeight.bulkScorer(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.IndexSearcher.search(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.IndexSearcher.search(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.IndexSearcher.search(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.IndexSearcher.searchAfter(Unknown Source)
	at org.apache.lucene.core@9.4.2/org.apache.lucene.search.IndexSearcher.search(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.logic.pdf.search.retrieval.PdfSearcher.search(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.model.search.rules.GrammarBasedSearchRule.init(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.model.search.rules.GrammarBasedSearchRule.validateSearchStrings(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.model.search.rules.SearchRules.getSearchRuleByQuery(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.logic.search.SearchQuery.<init>(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.gui.search.GlobalSearchBar.performSearch(Unknown Source)
	at org.jabref.merged.module@5.8.60000/org.reactfx.util.FxTimer.lambda$restart$0(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.scenario.animation.shared.TimelineClipCore.visitKeyFrame(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.scenario.animation.shared.TimelineClipCore.playTo(Unknown Source)
	at org.jabref.merged.module@5.8.60000/javafx.animation.Timeline.doPlayTo(Unknown Source)
	at org.jabref.merged.module@5.8.60000/javafx.animation.AnimationAccessorImpl.playTo(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.scenario.animation.shared.SingleLoopClipEnvelope.timePulse(Unknown Source)
	at org.jabref.merged.module@5.8.60000/javafx.animation.Animation.doTimePulse(Unknown Source)
	at org.jabref.merged.module@5.8.60000/javafx.animation.Animation$1.lambda$timePulse$0(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at org.jabref.merged.module@5.8.60000/javafx.animation.Animation$1.timePulse(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.scenario.animation.AbstractPrimaryTimer.timePulseImpl(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.scenario.animation.AbstractPrimaryTimer$MainLoop.run(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
	at org.jabref.merged.module@5.8.60000/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at org.jabref.merged.module@5.8.60000/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

@btut
Copy link
Contributor

btut commented Dec 20, 2022

Hi!
Thanks for reporting this. Unfortunately I am unable to reproduce the behavior you are seeing. Would you be so kind to share logs regarding this error message? (should be visible in 'Details anzeigen' in the error notification).

Some more things that you can try:

  • Do the same search while disabling fulltext search (the file icon with the eye in the right of the search bar)
  • Rebuild the index (Tools -> Rebuild fulltext search index)

Let me know if the issue still persists after that.

@teertinker
Copy link
Contributor Author

Hi! I added the log file.

@Siedlerchr
Copy link
Member

Siedlerchr commented Dec 20, 2022

Just found a simliar issue from @ThiloteE #8287 where I posted this link https://northcoder.com/post/lucene-fields-and-term-vectors/

@btut
Copy link
Contributor

btut commented Dec 21, 2022

Hm, I think the log you posted and the image do not fit well together, as they are different errors.

  • For the image, sounds like something is wrong with the index. It complains about the path field not having positional data, but it is stored as a StringField. StringFields should not require positional data as they are not tokenized but the whole string is stored as-is. Maybe we do something wrong when trying to display it afterwards? Will have a look. In that case, the issue would not really be the quotation marks.
  • For the log, this could be hard to solve. I think whats happening is that JabRef starts searching while you type and therefore at some point has a search string that includes a single quotation mark so it cannot find the closing quotation mark. You can see in the log that the search string was "bi. What we would need here would be additional query validation for lucene. Easy fix would be to just add closing quotation marks whenever an uneven number of quotation marks is found in the search string? Nice solution would be query validation and giving the user feedback if the closing quotation mark is missing and refusing search until syntax errors are fixed (which is on my list for things to implement for the full lucene search backend).

@teertinker
Copy link
Contributor Author

Thank you for the exploration. The error only occured with fulltext search activated and was accompanied by a lag while typing. So in my case it was probably caused by the second error. Another reason to deactivate fulltext search on default (#9491).

@koppor koppor added the bug Confirmed bugs or reports that are very likely to be bugs label Jan 2, 2023
@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Jan 2, 2023
@koppor koppor moved this from Normal priority to High priority in Prioritization Jan 2, 2023
@koppor koppor added this to the v6.0 milestone Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs search
Projects
Status: High priority
Development

No branches or pull requests

4 participants