It's either a feature (best-effort forgiving parsing) or a bug (number of comment closes do not match number of opens and we should return an error.) Unlike C, Solr supports nested comments. Both of your examples have two comment starts, but only one end, hence the entire string is commented from the first "/*".
-Yonik On Thu, May 16, 2024 at 3:01 PM Runar Espeland <runar.espel...@forsta.com.invalid> wrote: > Solr parsing non-ended comments inside comment, does not work as expected. > If there are non-ended comments inside a comment. Then it will treat > trailing words as comments > > Examples > samsung /* Motorola iphone */ -- > works. As expected > samsung /* motorola /* iphone */ ) --> works. Not as expected. Ignores > trailing ')' > ( samsung /* motorola /* iphone */ nokia ) -- > fails. Not as expected. > Because of starting '('. Ended ')' is ignored. Since it is read as a > comment. > > > Is this a bug ? > > Versions: > Solr-spec 8.11.1 > Lucene-spec 8.11.1 >