Buggy code:
assertU req ( "num_i:[0<seq2seq4repair_space>TO<seq2seq4repair_space>9]" ) , "*[count(////doc)=3]" ) ; assertQ ( req ( "num_i:[-2147483648<seq2seq4repair_space>TO<seq2seq4repair_space>2147483647]" ) , "*[count(////doc)=10]" ) ; assertQ ( req ( "num_i:[-10<seq2seq4repair_space>TO<seq2seq4repair_space>-1]" ) , "*[count(////doc)=1]" ) ; assertU ( "<delete><id>44<//id><//delete>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">1234567890<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">10<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">1<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">2<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">15<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">-1<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">-987654321<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">9223372036854775807<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">-9223372036854775808<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_l\">0<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:44" ) , "*[count(////doc)=10]" ) ; assertQ ( req ( "num_l:9223372036854775807" ) , "////@numFound[.='1']<seq2seq4repair_space>" , "////long[.='9223372036854775807']" ) ; assertQ ( req ( "num_l:\"-9223372036854775808\"" ) , "////@numFound[.='1']<seq2seq4repair_space>" , "////long[.='-9223372036854775808']" ) ; assertQ ( req ( "id:44;num_l<seq2seq4repair_space>asc;" ) , "////doc[1]//long[.='-9223372036854775808']<seq2seq4repair_space>" , "////doc[last()]//long[.='9223372036854775807']" ) ; assertQ ( req ( "id:44;num_l<seq2seq4repair_space>desc;" ) , "////doc[1]//long[.='9223372036854775807']<seq2seq4repair_space>" , "////doc[last()]//long[.='-9223372036854775808']" ) ; assertQ ( req ( "num_l:[-1<seq2seq4repair_space>TO<seq2seq4repair_space>9]" ) , "*[count(////doc)=4]" ) ; assertQ ( req ( "num_l:[-9223372036854775808<seq2seq4repair_space>TO<seq2seq4repair_space>9223372036854775807]" ) , "*[count(////doc)=10]" ) ; assertQ ( req ( "num_l:[-10<seq2seq4repair_space>TO<seq2seq4repair_space>-1]" ) , "*[count(////doc)=1]" ) ; assertU ( "<delete><id>44<//id><//delete>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">1.4142135<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">Infinity<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">-Infinity<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">NaN<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">2<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">-1<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">-987654321<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">-999999.99<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">-1e20<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sf\">0<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:44" ) , "*[count(////doc)=10]" ) ; assertQ ( req ( "num_sf:Infinity" ) , "////@numFound[.='1']<seq2seq4repair_space>" , "////float[.='Infinity']" ) ; assertQ ( req ( "num_sf:\"-Infinity\"" ) , "////@numFound[.='1']<seq2seq4repair_space>" , "////float[.='-Infinity']" ) ; assertQ ( req ( "num_sf:\"NaN\"" ) , "////@numFound[.='1']<seq2seq4repair_space>" , "////float[.='NaN']" ) ; assertQ ( req ( "num_sf:\"-1e20\"" ) , "////@numFound[.='1']" ) ; assertQ ( req ( "id:44;num_sf<seq2seq4repair_space>asc;" ) , "////doc[1]//float[.='-Infinity']<seq2seq4repair_space>" , "////doc[last()]//float[.='NaN']" ) ; assertQ ( req ( "id:44;num_sf<seq2seq4repair_space>desc;" ) , "////doc[1]//float[.='NaN']<seq2seq4repair_space>" , "////doc[last()]//float[.='-Infinity']" ) ; assertQ ( req ( "num_sf:[-1<seq2seq4repair_space>TO<seq2seq4repair_space>2]" ) , "*[count(////doc)=4]" ) ; assertQ ( req ( "num_sf:[-Infinity<seq2seq4repair_space>TO<seq2seq4repair_space>Infinity]" ) , "*[count(////doc)=9]" ) ; assertU ( "<delete><id>44<//id><//delete>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">1.4142135<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">Infinity<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">-Infinity<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">NaN<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">2<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">-1<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">1e-100<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">-999999.99<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">-1e100<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"num_sd\">0<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:44" ) , "*[count(////doc)=10]" ) ; assertQ ( req ( "num_sd:Infinity" ) , "////@numFound[.='1']<seq2seq4repair_space>" , "////double[.='Infinity']" ) ; assertQ ( req ( "num_sd:\"-Infinity\"" ) , "////@numFound[.='1']<seq2seq4repair_space>" , "////double[.='-Infinity']" ) ; assertQ ( req ( "num_sd:\"NaN\"" ) , "////@numFound[.='1']<seq2seq4repair_space>" , "////double[.='NaN']" ) ; assertQ ( req ( "num_sd:\"-1e100\"" ) , "////@numFound[.='1']" ) ; assertQ ( req ( "num_sd:\"1e-100\"" ) , "////@numFound[.='1']" ) ; assertQ ( req ( "id:44;num_sd<seq2seq4repair_space>asc;" ) , "////doc[1]//double[.='-Infinity']<seq2seq4repair_space>" , "////doc[last()]//double[.='NaN']" ) ; assertQ ( req ( "id:44;num_sd<seq2seq4repair_space>desc;" ) , "////doc[1]//double[.='NaN']<seq2seq4repair_space>" , "////doc[last()]//double[.='-Infinity']" ) ; assertQ ( req ( "num_sd:[-1<seq2seq4repair_space>TO<seq2seq4repair_space>2]" ) , "*[count(////doc)=5]" ) ; assertQ ( req ( "num_sd:[-Infinity<seq2seq4repair_space>TO<seq2seq4repair_space>Infinity]" ) , "*[count(////doc)=9]" ) ; assertU ( "<delete><id>44<//id><//delete>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"a_i\">10<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"a_i\">1<//field><field<seq2seq4repair_space>name=\"b_i\">100<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"a_i\">-1<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"a_i\">15<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"a_i\">1<//field><field<seq2seq4repair_space>name=\"b_i\">50<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id\">44<//field><field<seq2seq4repair_space>name=\"a_i\">0<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:44" ) , "*[count(////doc)=6]" ) ; assertQ ( req ( "id:44;<seq2seq4repair_space>a_i<seq2seq4repair_space>asc,b_i<seq2seq4repair_space>desc" ) , "*[count(////doc)=6]<seq2seq4repair_space>" , "////doc[3]//int[.='100']<seq2seq4repair_space>" , "////doc[4]//int[.='50']" ) ; assertQ ( req ( "id:44;a_i<seq2seq4repair_space>asc<seq2seq4repair_space>,<seq2seq4repair_space>b_i<seq2seq4repair_space>asc;" ) , "*[count(////doc)=6]<seq2seq4repair_space>" , "////doc[3]//int[.='50']<seq2seq4repair_space>" , "////doc[4]//int[.='100']" ) ; assertQ ( req ( "id:44;a_i<seq2seq4repair_space>asc;" ) , "*[count(////doc)=6]<seq2seq4repair_space>" , "////doc[1]//int[.='-1']<seq2seq4repair_space>" , "////doc[last()]//int[.='15']" ) ; assertQ ( req ( "id:44;a_i<seq2seq4repair_space>asc<seq2seq4repair_space>,<seq2seq4repair_space>score<seq2seq4repair_space>top;" ) , "*[count(////doc)=6]<seq2seq4repair_space>" , "////doc[1]//int[.='-1']<seq2seq4repair_space>" , "////doc[last()]//int[.='15']" ) ; assertQ ( req ( "id:44;<seq2seq4repair_space>score<seq2seq4repair_space>top<seq2seq4repair_space>,<seq2seq4repair_space>a_i<seq2seq4repair_space>top,<seq2seq4repair_space>b_i<seq2seq4repair_space>bottom<seq2seq4repair_space>;" ) , "*[count(////doc)=6]<seq2seq4repair_space>" , "////doc[last()]//int[.='-1']<seq2seq4repair_space>" , "////doc[1]//int[.='15']<seq2seq4repair_space>" , "////doc[3]//int[.='50']<seq2seq4repair_space>" , "////doc[4]//int[.='100']" ) ; assertU ( "<delete><query>id_i:[1000<seq2seq4repair_space>TO<seq2seq4repair_space>1010]<//query><//delete>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id_i\">1000<//field><field<seq2seq4repair_space>name=\"a_i\">1<//field><field<seq2seq4repair_space>name=\"nullfirst\">Z<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id_i\">1001<//field><field<seq2seq4repair_space>name=\"a_i\">10<//field><field<seq2seq4repair_space>name=\"nullfirst\">A<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id_i\">1002<//field><field<seq2seq4repair_space>name=\"a_i\">1<//field><field<seq2seq4repair_space>name=\"b_si\">100<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id_i\">1003<//field><field<seq2seq4repair_space>name=\"a_i\">-1<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id_i\">1004<//field><field<seq2seq4repair_space>name=\"a_i\">15<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id_i\">1005<//field><field<seq2seq4repair_space>name=\"a_i\">1<//field><field<seq2seq4repair_space>name=\"b_si\">50<//field><//doc><//add>" ) ; assertU ( "<add<seq2seq4repair_space>allowDups=\"true\"><doc><field<seq2seq4repair_space>name=\"id_i\">1006<//field><field<seq2seq4repair_space>name=\"a_i\">0<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id_i:[1000<seq2seq4repair_space>TO<seq2seq4repair_space>1010]" ) , "*[count(////doc)=7]" ) ; assertQ ( req ( "id_i:[1000<seq2seq4repair_space>TO<seq2seq4repair_space>1010];<seq2seq4repair_space>b_si<seq2seq4repair_space>asc" ) , "*[count(////doc)=7]<seq2seq4repair_space>" , "////doc[1]//int[.='50']<seq2seq4repair_space>" , "////doc[2]//int[.='100']" ) ; assertQ ( req ( "id_i:[1000<seq2seq4repair_space>TO<seq2seq4repair_space>1010];<seq2seq4repair_space>b_si<seq2seq4repair_space>desc" ) , "*[count(////doc)=7]<seq2seq4repair_space>" , "////doc[1]//int[.='100']<seq2seq4repair_space>" , "////doc[2]//int[.='50']" ) ; assertQ ( req ( "id_i:[1000<seq2seq4repair_space>TO<seq2seq4repair_space>1010];<seq2seq4repair_space>a_i<seq2seq4repair_space>asc,b_si<seq2seq4repair_space>desc" ) , "*[count(////doc)=7]<seq2seq4repair_space>" , "////doc[3]//int[.='100']<seq2seq4repair_space>" , "////doc[4]//int[.='50']<seq2seq4repair_space>" , "////doc[5]//int[.='1000']" ) ; assertQ ( req ( "id_i:[1000<seq2seq4repair_space>TO<seq2seq4repair_space>1010];<seq2seq4repair_space>a_i<seq2seq4repair_space>asc,b_si<seq2seq4repair_space>asc" ) , "*[count(////doc)=7]<seq2seq4repair_space>" , "////doc[3]//int[.='50']<seq2seq4repair_space>" , "////doc[4]//int[.='100']<seq2seq4repair_space>" , "////doc[5]//int[.='1000']" ) ; assertQ ( req ( "id_i:[1000<seq2seq4repair_space>TO<seq2seq4repair_space>1002];<seq2seq4repair_space>nullfirst<seq2seq4repair_space>asc" ) , "*[count(////doc)=3]<seq2seq4repair_space>" , "////doc[1]//int[.='1002']" , "////doc[2]//int[.='1001']<seq2seq4repair_space>" , "////doc[3]//int[.='1000']" ) ; assertQ ( req ( "id_i:[1000<seq2seq4repair_space>TO<seq2seq4repair_space>1002];<seq2seq4repair_space>nullfirst<seq2seq4repair_space>desc" ) , "*[count(////doc)=3]<seq2seq4repair_space>" , "////doc[1]//int[.='1002']" , "////doc[2]//int[.='1000']<seq2seq4repair_space>" , "////doc[3]//int[.='1001']" ) ; ignoreException ( "shouldbeunindexed" ) ; ignoreException ( "nullfirst" ) ; ignoreException ( "abcde12345" ) ; ignoreException ( "aaa" ) ; assertQEx ( "can<seq2seq4repair_space>not<seq2seq4repair_space>sort<seq2seq4repair_space>unindexed<seq2seq4repair_space>fields" , req ( "id_i:1000;<seq2seq4repair_space>shouldbeunindexed<seq2seq4repair_space>asc" ) , 400 ) ; assertQEx ( "invalid<seq2seq4repair_space>query<seq2seq4repair_space>format" , req ( "id_i:1000;<seq2seq4repair_space>nullfirst" ) , 400 ) ; assertQEx ( "unknown<seq2seq4repair_space>sort<seq2seq4repair_space>field" , req ( "id_i:1000;<seq2seq4repair_space>abcde12345<seq2seq4repair_space>asc" ) , 400 ) ; assertQEx ( "unknown<seq2seq4repair_space>sort<seq2seq4repair_space>order" , req ( "id_i:1000;<seq2seq4repair_space>nullfirst<seq2seq4repair_space>aaa" ) , 400 ) ; resetExceptionIgnores ( ) ; assertU ( "<delete><query>val_s:[*<seq2seq4repair_space>TO<seq2seq4repair_space>*]<//query><//delete>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">100<//field><field<seq2seq4repair_space>name=\"val_s\">apple<//field><//doc><//add>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">101<//field><field<seq2seq4repair_space>name=\"val_s\">banana<//field><//doc><//add>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">102<//field><field<seq2seq4repair_space>name=\"val_s\">apple<//field><//doc><//add>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">103<//field><field<seq2seq4repair_space>name=\"val_s\">pearing<//field><//doc><//add>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">104<//field><field<seq2seq4repair_space>name=\"val_s\">pear<//field><//doc><//add>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">105<//field><field<seq2seq4repair_space>name=\"val_s\">appalling<//field><//doc><//add>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">106<//field><field<seq2seq4repair_space>name=\"val_s\">pearson<//field><//doc><//add>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">107<//field><field<seq2seq4repair_space>name=\"val_s\">port<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "val_s:a*" ) , "////*[@numFound='3']" ) ; assertQ ( req ( "val_s:p*" ) , "////*[@numFound='4']" ) ; assertQ ( req ( "val_s:a*p*" ) , "////*[@numFound='3']" ) ; assertQ ( req ( "val_s:p?a*" ) , "////*[@numFound='3']" ) ; assertU ( "<delete><query>id:[100<seq2seq4repair_space>TO<seq2seq4repair_space>110]<//query><//delete>" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">42<//field><field<seq2seq4repair_space>name=\"title\">How<seq2seq4repair_space>Now4<seq2seq4repair_space>brown<seq2seq4repair_space>Cows<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>title:Now" ) , "*[count(////doc)=0]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>title_lettertok:Now" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>title:cow" ) , "*[count(////doc)=0]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>title_stemmed:cow" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>text:cow" ) , "*[count(////doc)=1]" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">42<//field><field<seq2seq4repair_space>name=\"copy_t\">Copy<seq2seq4repair_space>me<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>text<seq2seq4repair_space>field<seq2seq4repair_space>pretty<seq2seq4repair_space>please.<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>text:pretty" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>copy_t:pretty" ) , "*[count(////doc)=1]" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">42<//field><field<seq2seq4repair_space>name=\"text\">foo<seq2seq4repair_space>bar<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>text:\"foo<seq2seq4repair_space>bar\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>text:\"foo\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>text:\"bar\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>text:\"bar<seq2seq4repair_space>foo\"" ) , "*[count(////doc)=0]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>text:\"bar<seq2seq4repair_space>foo\"~2" ) , "*[count(////doc)=1]" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">42<//field><field<seq2seq4repair_space>name=\"subword\">foo<seq2seq4repair_space>bar<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"foo<seq2seq4repair_space>bar\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"foo\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"bar\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"bar<seq2seq4repair_space>foo\"" ) , "*[count(////doc)=0]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"bar<seq2seq4repair_space>foo\"~2" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"foo//bar\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"foobar\"" ) , "*[count(////doc)=0]" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">42<//field><field<seq2seq4repair_space>name=\"subword\">foo-bar<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"foo<seq2seq4repair_space>bar\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"foo\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"bar\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"bar<seq2seq4repair_space>foo\"" ) , "*[count(////doc)=0]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"bar<seq2seq4repair_space>foo\"~2" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"foo//bar\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:foobar" ) , "*[count(////doc)=1]" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">42<//field><field<seq2seq4repair_space>name=\"subword\">Canon<seq2seq4repair_space>PowerShot<seq2seq4repair_space>SD500<seq2seq4repair_space>7MP<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"power-shot\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"power<seq2seq4repair_space>shot<seq2seq4repair_space>sd<seq2seq4repair_space>500\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"powershot\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"SD-500\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"SD500\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"SD500-7MP\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"PowerShotSD500-7MP\"" ) , "*[count(////doc)=1]" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">42<//field><field<seq2seq4repair_space>name=\"subword\">Wi-Fi<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:wifi" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:wi+=fi" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:wi+=fi" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:WiFi" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"wi<seq2seq4repair_space>fi\"" ) , "*[count(////doc)=1]" ) ; assertU ( "<add><doc><field<seq2seq4repair_space>name=\"id\">42<//field><field<seq2seq4repair_space>name=\"subword\">\'I.B.M\'<seq2seq4repair_space>A\'s,B\'s,C\'s<//field><//doc><//add>" ) ; assertU ( "<commit//>" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"\'I.B.M.\'\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:I.B.M" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:IBM" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:I--B--M" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"I<seq2seq4repair_space>B<seq2seq4repair_space>M\"" ) , "*[count(////doc)=1]" ) ; assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:IBM's" ) , "*[count(////doc)=1]" ) ; <START_BUG> assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:IBM'sx" ) , "*[count(////doc)=0]" ) ; <END_BUG>

Fix:
assertQ ( req ( "id:42<seq2seq4repair_space>AND<seq2seq4repair_space>subword:\"IBM\'sx\"" ) , "*[count(////doc)=0]" ) ;