From 8e8db1801c715967e9ad8a3cbf4520867b034b4f Mon Sep 17 00:00:00 2001 From: James Agnew Date: Tue, 6 Oct 2015 06:46:51 -0400 Subject: [PATCH] Start work on FT search --- .../segments_1 | Bin 0 -> 71 bytes .../write.lock | 0 .../segments_1 | Bin 0 -> 71 bytes .../write.lock | 0 .../segments_1 | Bin 0 -> 71 bytes .../write.lock | 0 .../segments_1 | Bin 0 -> 71 bytes .../write.lock | 0 .../_0.cfe | Bin 0 -> 299 bytes .../_0.cfs | Bin 0 -> 2081 bytes .../_0.si | Bin 0 -> 359 bytes .../_1.cfe | Bin 0 -> 299 bytes .../_1.cfs | Bin 0 -> 2040 bytes .../_1.si | Bin 0 -> 359 bytes .../_2.cfe | Bin 0 -> 299 bytes .../_2.cfs | Bin 0 -> 2081 bytes .../_2.si | Bin 0 -> 359 bytes .../_3.cfe | Bin 0 -> 299 bytes .../_3.cfs | Bin 0 -> 2040 bytes .../_3.si | Bin 0 -> 359 bytes .../segments_5 | Bin 0 -> 322 bytes .../write.lock | 0 .../_0.cfe | Bin 0 -> 299 bytes .../_0.cfs | Bin 0 -> 2022 bytes .../_0.si | Bin 0 -> 359 bytes .../_1.cfe | Bin 0 -> 299 bytes .../_1.cfs | Bin 0 -> 2026 bytes .../_1.si | Bin 0 -> 359 bytes .../_2.cfe | Bin 0 -> 299 bytes .../_2.cfs | Bin 0 -> 2022 bytes .../_2.si | Bin 0 -> 359 bytes .../_3.cfe | Bin 0 -> 299 bytes .../_3.cfs | Bin 0 -> 2026 bytes .../_3.si | Bin 0 -> 359 bytes .../segments_5 | Bin 0 -> 322 bytes .../write.lock | 0 .../segments_1 | Bin 0 -> 71 bytes .../write.lock | 0 .../java/ca/uhn/fhir/jpa/dao/ISearchDao.java | 11 ++++ .../java/ca/uhn/fhir/jpa/dao/SearchDao.java | 53 ++++++++++++++++++ .../uhn/fhir/jpa/dao/SearchParameterMap.java | 1 - .../BaseResourceIndexedSearchParam.java | 5 ++ .../ResourceIndexedSearchParamCoords.java | 5 ++ .../ResourceIndexedSearchParamDate.java | 11 ++++ .../ResourceIndexedSearchParamNumber.java | 4 ++ .../ResourceIndexedSearchParamQuantity.java | 12 +++- .../ResourceIndexedSearchParamString.java | 16 ++++-- .../ResourceIndexedSearchParamToken.java | 9 ++- .../entity/ResourceIndexedSearchParamUri.java | 5 ++ .../ca/uhn/fhir/jpa/entity/ResourceTable.java | 20 +++---- .../fhir-spring-search-config-dstu2.xml | 21 +++++++ .../fhir/jpa/dao/FhirSearchDaoDstu2Test.java | 39 +++++++++++++ .../test/resources/META-INF/persistence.xml | 3 + 53 files changed, 193 insertions(+), 22 deletions(-) create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamCoords/segments_1 create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamCoords/write.lock create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate/segments_1 create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate/write.lock create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber/segments_1 create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber/write.lock create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamQuantity/segments_1 create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamQuantity/write.lock create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_0.cfe create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_0.cfs create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_0.si create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.cfe create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.cfs create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.si create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.cfe create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.cfs create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.si create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.cfe create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.cfs create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.si create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/segments_5 create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/write.lock create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.cfe create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.cfs create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.si create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_1.cfe create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_1.cfs create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_1.si create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_2.cfe create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_2.cfs create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_2.si create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_3.cfe create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_3.cfs create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_3.si create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/segments_5 create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/write.lock create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamUri/segments_1 create mode 100644 hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamUri/write.lock create mode 100644 hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/ISearchDao.java create mode 100644 hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchDao.java create mode 100644 hapi-fhir-jpaserver-base/src/main/resources/fhir-spring-search-config-dstu2.xml create mode 100644 hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSearchDaoDstu2Test.java diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamCoords/segments_1 b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamCoords/segments_1 new file mode 100644 index 0000000000000000000000000000000000000000..58a2f285f60e8a00b0e5bff5bb681849d90cb073 GIT binary patch literal 71 zcmcD&o+HjtoSL4SnpaZHz`(#JdoOv#)%tgT=9^~q>}hz)#c0UN3={_gCK!X^fX3t( KFwVTwD)Im(JQ9)s literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamCoords/write.lock b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamCoords/write.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate/segments_1 b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate/segments_1 new file mode 100644 index 0000000000000000000000000000000000000000..7aff7c30bae0d467cb9e91482dd5132d0058917a GIT binary patch literal 71 zcmcD&o+HjtoSL4SnpaZHz`(#JdoOv#)%tgT=9^~q>}hz)&uGZX3={_gCK!X^fX3t( KFwW}D`CR}f>=Qx& literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate/write.lock b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate/write.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber/segments_1 b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber/segments_1 new file mode 100644 index 0000000000000000000000000000000000000000..be6640832460b3e68370b389e033ad00ee075be1 GIT binary patch literal 71 zcmcD&o+HjtoSL4SnpaZHz`(#JdoOv#)%tgT=9^~q>}hz)&1lHV3={_gCK!X^fX3t( KFwO*>Gv@#%O%pu; literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber/write.lock b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber/write.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamQuantity/segments_1 b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamQuantity/segments_1 new file mode 100644 index 0000000000000000000000000000000000000000..9662ae739460f4bf0dcc24dc694a03d05fd762d3 GIT binary patch literal 71 zcmcD&o+HjtoSL4SnpaZHz`(#JdoOv#)%tgT=9^~q>}hz)%V@~T3={_gCK!X^fX3t( KFwVA`eHs8KVG{uW literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamQuantity/write.lock b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamQuantity/write.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_0.cfe b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_0.cfe new file mode 100644 index 0000000000000000000000000000000000000000..cfffd3c842fd418f98a3fcbbcaa497b554281a62 GIT binary patch literal 299 zcmcD&o+B>qQ<|KbmuhO@oS$2eUz(TVnpaYknOe*M1hV&%S6r=s_h-IoR?nV>r@{=J z{P8g5@dkPY`CwH*g?b>>K#JGE$<&~vCILviW zL2IB%DHTw`olwCL6q8c&lOf_PyioZT6#0@&s7qKTLgbkWK{i1J*_oi4l0Y_5s1Sk8)OrvC$i8_ub5?G0^DsR3#{JrraIs16I@}o@{W!9aZ^^|E-oy^!bES+MD z^=i2^c-HxTK3%_j?0vTG&8|-`M0lvE=bYAYQO%Ho8w2b~OK!<)`Wj89?9UBSyZZCVDRiGuqHc|q!#+2uk(p9lSt;bc^B2n!!EoU7P2%a($3P6MtawzYR0jUDSe-qjsH(ZjH2 zB`AyHR!f#yL-yxjPM0@$4$+;bI<6~}#oq5w-Sg}6;P7<5bu+ol_)GE?Al^$UC{fl( zqM+$kVzz`5m{6TM2~V3Ys94QnWGR}<^ena51qcHIynP|k2?oF*7y?N!3{p*iA?!U- zb&P?|dXVu=0FnUYa4JwhhF)~!8T~#c5@DJNl{AxJsw*Mx2-(x1W|%Sag-~n_mJroh zN<5r)MaB|B$UaN4O>H+L+fAm#6*#9;jhKY+`>m)yz-nIm^uadtVX4r7)lP_uX>_FetH~a4&y? z7$;oE4h>FViqv|)K&I-gvLJ4^r0o{}$$j0n9wgS;BzRgzc3Bf^;}G7|zRu;UI`c}G6`lkaoQ<|KbmuhMdoSL4SnpfhPmzK}Kz`!VbFL}k)`geckn`ZUwX?Q9O6k}io zVrCEn2-q08I7>2fQ;SOya|?J4O-xJ-EG*3pjSY>A`Lhzs67|Y*^~zFKW@9uodT*7A2>$rsb3t zXRrgcCl)1VuvJ)?#haOkfbA(N%>%gurj5r?&s@(S9%P@PB@e_U5NB|}WVoTCc`5lt zLjFaG$vLSC&iO?J`9+B(K<6^E#T)1)rxin}R8}CbIFnHx9!@3sMX4!nnW;G`#cugU kxrrrux%nxnTu!dRA@RWhuC6WzG$y}*1QG*-+&slx0I(o!_y7O^ literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.cfe b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.cfe new file mode 100644 index 0000000000000000000000000000000000000000..ed29c3e23b645ba4dbd5739b5a09d75d3755a971 GIT binary patch literal 299 zcmcD&o+B>qQ<|KbmuhO@oS$2eUz(TVnpaYknOe*M1hV&%S6r=s_h-IoR?nV>r{WBp zEP8omxgaSZ(1TD6Ni2G4DHTx81SlQC9}hD)-axM;6Q=12M4qV#q^ShLVGe_8nvbF> zB|jM|{}n1<4zfN4!ePmQ3R$}fk?9|qc#2eqCx3nIv*grcb+AM9NQ2KFAP RrkDd7lV3pD493=ZDF8n}Jahm6 literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.cfs b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.cfs new file mode 100644 index 0000000000000000000000000000000000000000..93250da550b34ae562115f75e5dc7427c4c516f0 GIT binary patch literal 2040 zcmcIl&1(}u6yKf6S6lntT5B7lh+t8cq*@9>sMrz++8Rty^k5iwC*7_45qBpwQNjEH ziU$uK)q~)vP%j=-=s`SqtVlh1C_tCmf;jgk(6pJfaS?KYj=+KCt~ z2RX1?hv5K5iy?ljrM{ju646SS%e`E^9gAo#!e8tp>7D3u3P731{EQ3E-@nKiH|SAk zGmF={Yb%MXRS^jx0SU=fN!V@8B2cTOFceE9g%g=+I1P&%8sg*9yAB>+zZc#{W=~i$ zPpJW~(a~e*cpw-GN1B>j4z#wlcXW1j_w*j@JJf%8U@&?lCSqLs_^XnA5&gnpJJ(=q z)1&U7@tY>+-+bbx-5Xoj8wQPfn495LHU}92i!ok?i6pv>?UM$#m4+6#(+#g|CymUx z($Pt|@&ww>U9bEpynH+Rm&elO72Ta_X|rHCpuCj{!H&GD-J-Th7|qK%aU219kq=D1 zP&7kr*MoO=Dc-kCD!5z31F5IxlnMo{EXD&yC9S}W*mK8iM#YsiaV31V8jOY!M~p&t(QNiIYa8SC0sOTRfD#4N%#N9@0+DgfAF8J Hh1iXM!7ivG literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.si b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_1.si new file mode 100644 index 0000000000000000000000000000000000000000..60c08eb6ba0fc79e4881eea10428640f5d7540cc GIT binary patch literal 359 zcmcD&o+B>oQ<|KbmuhMdoSL4SnpfhPmzK}Kz`!VbFL}k)`geckn`ZUwX?Q9Q6k}io zVrCEn2$&hUI7>2fQ;SOya|?J4O-xJ-EG*3pjSbCA__Gqr67|Y*^~zFKW@9uodT*7A2>$rsb3t zXRrgcCl)1VuvJ)?#haOkfbA(N%>%gurj5r?&s@(S9%P@PB@e_U5NB|}WVoTCc`5lt zLjFaG$vLSC&iO?J`9+B(K<6^E#vAGtXR-mwOF k+{6;S-29YOE+^OEkoe#LS67z<8k1i@0*QfP)nu<+0J$V?s{jB1 literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.cfe b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.cfe new file mode 100644 index 0000000000000000000000000000000000000000..82e3e0d70510dc0b252276666ed10961ce5ce57c GIT binary patch literal 299 zcmcD&o+B>qQ<|KbmuhO@oS$2eUz(TVnpaYknOe*M1n~vO&aS#}Q;5N1^IiKReq{`t z{P8g5@dkP+`N<$vK%fVq7+P5L^2&0doJ~+V2}M&uKGZ!l|Ky9Q~}{IYe5A=&@@4v$6N>1TnN;Z2Nh&}4;558 PpfULc)BuK-PkFNeDXTmu literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.cfs b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.cfs new file mode 100644 index 0000000000000000000000000000000000000000..ce2f91e807481d124f1fb9666b73176a96c4277e GIT binary patch literal 2081 zcmcIl%WD%s7@wKl&7<$6t!?c~(L)a!YF`1Z6l@7bYz-z_@L(8sC(Y_U(%nhzsz}cY zRX~xZK;%46Q*2A zrN)!a_M=0G(GgJ!1ViDP+PeCN#->QLxux|$TYJaB&aUpBUMTPZ!$E1|O=24%{J!t; zZ*G|n34VUgV`wc|9h@>P-JT>AE7d|q8=3&z5jNk%&9`+n8vP#rEIu)J$dcvEb+-cJ z%hEGldG)(mnhxIMt|Dd0RK?z}s-9}^;i_F8x@l@!L`kSbQ|tt`X~_!Q8Yoy;fC$t9 z1V-17gSd=i#k>*A~2es0svh-UEcu* z;2<1=!*B$~>mbX{d!ouXOPK8tD;R(xfKoUf$YEX89BD?KBZg>TorDT`(;!rpLtGKD zr$$LK6|RVcNU(sZ%Gk)=dvfFN28@e40$Zxs+) z3G<8p&whi%koZY_;_10ZF5x`pxa}fogRjWt;**j1C)-?_KPTx^o$8 oMZ*6#H9`re++O>r)g8Cr2qf` literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.si b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_2.si new file mode 100644 index 0000000000000000000000000000000000000000..ac42b2c309c6e507e988407a9b2324e9529e6b62 GIT binary patch literal 359 zcmcD&o+B>oQ<|KbmuhMdoSL4SnpfhPmzK}Kz`z(^aO~`=3pa%rJT~98KjK#g6k}io zVrCEn2-q08I7>2fQ;SOya|?J4O-xJ-EG*3}Oe{?;__Gqr67|Y*^~zFKW@9uodT*7A2>$rsb3t zXRrgcCl)1VuvJ)?#haOkfbA(N%>%gurj5r?&s@(S9%P@PB@e_U5NB|}WVoTCc`5lt zLjFaG$vLSC&iO?J`9+B(K<6^E#vADsXR-mwOF k+{6;S-29YOE+^OEkoe#LS67z<8k1i@0*Qg)+S9aS0J^$v*8l(j literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.cfe b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.cfe new file mode 100644 index 0000000000000000000000000000000000000000..f345407f8fe26cf10f79b0baf900bc8912daa15b GIT binary patch literal 299 zcmcD&o+B>qQ<|KbmuhO@oS$2eUz(TVnpaYknOe*M1n~vO&aS#}Q;5N1^IiKRepL*d zEP81v6(A`f(1TD6A^h<$GvW>ON-}ey;!O~msfa}{uPg=1`2v-+M$=RP5ogwi${$9N zFUSYGhk=3l6I4D1=#o6BO)P#8K_(@TO;ABLsEG_oAUBslRIpuwYM+l{d`f;YM4Y`4 SDqns;WAY0qn_&X0>@@)XzdN-6 literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.cfs b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.cfs new file mode 100644 index 0000000000000000000000000000000000000000..73b409208e5865a12034d7614b3167663796d925 GIT binary patch literal 2040 zcmcIl&ubGw6rP<;vT3VLo3z&cvWgTeLP#p5UerLZeEQ2ib9`?P9)FN2PX;@dB9CB#h zRB(+&35UXmoPD$Sxu(wEj$R+?o*dj z-c|s|7@mQKW>?KoP(P87TqNDVR>f^ms&IsR^JB-C%jL5tPQli`o-xhD>DOsI6Ki zrkdPvn_+H{d5YbVji|ukO(&-d|FSvku?OmfT>Ymgz_loUah#-&VUGw;(Tw z1FPYttC5XnzS2&!)##eHIyo=9FIla5_CA;bUD~|GS^Jw84l5%b)1qwZn2p~c_C!q< zICk8}_Bun}tazY@n?ks&tZEN2F%iXOSx1fon4)+03=S7C@eusl&T;kAWW{?#eUhWx zoNA?_)r3^YaPx|A3c#I)>-UM0Yhwuh|K4MUdl%_d%-gb#DHczGqr-5$&bGiBRp=D( zg9>@^r?$!!(z~zr<}pReQ5O!=bKRbajZvsE;#!FX84~ZTDb6tD%j4i3wO8ne)wr_4 zI&uU+kl9UwlXk=?>x3CFHj>VO(ZV8|jSKs(yDx92;w{Q=){=Q@Ey@pGyaX?Y!VxLj r*4}aEY-g;iJD%w2J=b@>e_(KE_`(S5E%i_ERMxjAKyW_r@%fK`V|kmu literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.si b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/_3.si new file mode 100644 index 0000000000000000000000000000000000000000..4d622db680311c2adee3a0fb5613605b94197c50 GIT binary patch literal 359 zcmcD&o+B>oQ<|KbmuhMdoSL4SnpfhPmzK}Kz`z(^aO~`=3pa%rJT~98KjK#f6k}io zVrCEn2$&hUI7>2fQ;SOya|?J4O-xJ-EG*3}ObrZ7__Gqr67|Y*^~zFKW@9uodT*7A2>$rsb3t zXRrgcCl)1VuvJ)?#haOkfbA(N%>%gurj5r?&s@(S9%P@PB@e_U5NB|}WVoTCc`5lt zLjFaG$vLSC&iO?J`9+B(K<6^E#T)A-rxmjTsp3osCzVki9!@3sMX4!nnW;G`#cugU kxrrrux%nxnTu!dRA@RWhuC6WzG$y}*1QG*7N$R>q0I1Y%3;+NC literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/segments_5 b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/segments_5 new file mode 100644 index 0000000000000000000000000000000000000000..1bce37ddb622663ec4ce0604fcd2010abd75e9cb GIT binary patch literal 322 zcmcD&o+HjtoSL4SnpaZHz`(#3UvTW~stY%T7(6!LwLjul&1lNX3={_gJ|M{g!ayOW zcmqb+d&w)V*1!8R-!!XdPs3AT4xiHG)Vx$v}F`~J% bj1=9*=(?+j*UfN1WAY2IAArQ)ob7=CRnDUy literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/write.lock b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString/write.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.cfe b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.cfe new file mode 100644 index 0000000000000000000000000000000000000000..60a9401621cab40b64f8614b97fdb3df098e6926 GIT binary patch literal 299 zcmcD&o+B>qQ<|KbmuhO@oS$2eUz(TVnpaYknOe*M1hV&%S6r=s_h-IoR?nV>r-BTe z{P8g5@dkPY`CwH*g?b>>KoHELmzI|cVKX#BXr^)$O(mHHQ1Ks7b+=jc^2$;m9OlbV zL2IB%DHRY73m;T47{#QN{A8$nB2+#PMZP2x>Jpao5P2p(kWElQw!2VGIUt)#ARKm2 Ss9^5_jma;dYzFT*p-cdmw>&HW literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.cfs b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.cfs new file mode 100644 index 0000000000000000000000000000000000000000..a26fbaa7377214b0aae3f543101458c793c7f01f GIT binary patch literal 2022 zcmcIlOK1~87@kKqNn353KCHEg54?Dg5Rq!B)oLxlmbMfV^rUs%otSO2yI~*DMZpLj zwI1{?6bqj8;7tXkdhz5*y!8+edMeVJBIwK{Tc>SOp_qkb|M};C&-cv^e=YQMO?WCb zX@BaXWfU#X)JBO*0DBTE>hmvm*M2?ipMCJQ^eqO4nRRbqJ#9IzZr*aP+PX_^wyNdQ z99Yk!_%;CVk3C+kNC1rgSS|999f46=rv+`y%!ycVTl#SOOkTf9ZIifkMlBG>0SJTN z)dwY}sVyP|m8C7)AZ{`zKG7gaJu}D4<@9-&3K{;G1{)AKYWNx7ajAj8|F62$@Gn!x z@@$o6{UXH;NYP^W)5Ipm6ftP10r4Y-e}xo0sx%zCGyT@wLMGOlG)O%TdS6UPnavz?cS)dImF zd%Vs(}(hB Kc|CFMMdS}k$)Py_ literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.si b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_0.si new file mode 100644 index 0000000000000000000000000000000000000000..e5f8ebbc4728826712b9c0999fcb40a3d020aabc GIT binary patch literal 359 zcmcD&o+B>oQ<|KbmuhMdoSL4SnpfhPmzK}Kz`!VbFL}k)`geckn`ZUwX?Q9K6k}io zVrCEn2pAc;I7>2fQ;SOya|?J4O-xJ-EG*3pjSUS<__Gqr67|Y*^~zFKW@9uodT*7A2>$rsb3t zXRrgcCl)1VuvJ)?#haOkfbA(N%>%gurj5r?&s@(S9%P@PB@e_U5NB|}WVoTCc`5lt zLjFaG$vLSC&iO?J`9+B(K<6^E#T)1)rxin}R8}CbIFnHx9!@3sMX4!nnW;G`#cugU kxrrrux%nxnTu!dRA@RWhuC6WzG$y}*1QG*-!35bJ0H*V94*&oF literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_1.cfe b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_1.cfe new file mode 100644 index 0000000000000000000000000000000000000000..9dc809bc4b80e42002515f0925f423c2e89f55f3 GIT binary patch literal 299 zcmcD&o+B>qQ<|KbmuhO@oS$2eUz(TVnpaYknOe*M1hV&%S6r=s_h-IoR?nV>r=kp; zEP8omxgaSZ(1TD6IV^fY~nz#h;mH4W?{`~mI?-!$sPdCcny1@kZ?%wepnX#GaOjDQWwcL>a z5o-lk-h3C?-6^}fKYX>mJ^%cBV0r)H$vu%P5mc6SZASHsL5sSRA&xs`>2#TU!viHE z$gNh^T5SK+fEQs-i(wY#&Kyb7BHMY|Q2PIZ6Lj({S|9Jr%@;AgdcL>APe4?B0L^XXu zHG6fIwl%?^j>^#BDRd^HMAcYRy!pt{me#iRj?S*`V?Din$NL8oCr*a5jrYE471`Q% zvQ>JyX4{8DucQ}#iO|lyeH1igy+#sYIFrqBA_{;QZ}Is6Wp{yugwVH3Vs;|0M z%~#!)*2~kH{|vt5(?PEFFtxeO;aj4{j^GaDyqU7{w!@td>LA)SUoaLZvxrOQwIXpG zfG`llOe~a`rA#6OSDE1hleo#ee8qw!wcH#ppEs6aDq{LmI&1)N%=ELB0RjGh)h(tU z%(k3gqPPJmnoVC$${AwPNCWUy)4xNC9#tBE9hTi-^Tm%sb~Rd`t4Bz+PU}l0gD~U+ N^U<5|`P|0(>A&sJp6LJp literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_1.si b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_1.si new file mode 100644 index 0000000000000000000000000000000000000000..5da78ffc63092051a00109e8f52d1b99d709689f GIT binary patch literal 359 zcmcD&o+B>oQ<|KbmuhMdoSL4SnpfhPmzK}Kz`!VbFL}k)`geckn`ZUwX?Q9M6k}io zVrCEn2pAc;I7>2fQ;SOya|?J4O-xJ-EG*3pjSWo=__Gqr67|Y*^~zFKW@9uodT*7A2>$rsb3t zXRrgcCl)1VuvJ)?#haOkfbA(N%>%gurj5r?&s@(S9%P@PB@e_U5NB|}WVoTCc`5lt zLjFaG$vLSC&iO?J`9+B(K<6^E#vAGtXR-mwOF k+{6;S-29YOE+^OEkoe#LS67z<8k1i@0*QfP-ke)*0I%e42mk;8 literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_2.cfe b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_2.cfe new file mode 100644 index 0000000000000000000000000000000000000000..91ea7c3833b88273a94c80f1a74cd34217608266 GIT binary patch literal 299 zcmcD&o+B>qQ<|KbmuhO@oS$2eUz(TVnpaYknOe*M1n~vO&aS#}Q;5N1^IiKRekBZ? z{P8g5@dkP+`N<$vK%fVq81h*3^2&0doHA7&cBQ-9>`oI_J#h1e z2M>mm3DJue4<0<27!QPa(Qwk3C{Yf^cryG0I5TB&fEE*CC)w}5Y2p3z#n0{F!ppD8`7{Gb9^Df}PdFYk?c3fp*JRWk zb@XZ}jX`uSfesu*10gLOi8eGg?b_Yk(%RPE(b=`9dvDLa-oDuW{r$Gf{2XLDXN@-Zpok*Ua4M7KVH$uKFZ1((a)K1ER@EDxsTLbvs^*Q%RrRh& z@5yo9e+Zw!$^n7bDz%G+^N#2-R!irAa)sr(yQTgBNldf@77x@R*&K_sQ0&3b*D8 z<}K>lgwdQ{B%TKl2I9673&kd=D-nX}Nbwtyuy|g+qCt^bVO}|(H>Y4CWcgzTtOIb= z@-vlT0RO-1X3Gz*uB>08xDF+nEMH!PX=2e(9q=QTf0Y!=RI3BFI(CoQ<|KbmuhMdoSL4SnpfhPmzK}Kz`z(^aO~`=3pa%rJT~98KjK#c6k}io zVrCEn2pAc;I7>2fQ;SOya|?J4O-xJ-EG*3}Oe~Eo`Lhzs67|Y*^~zFKW@9uodT*7A2>$rsb3t zXRrgcCl)1VuvJ)?#haOkfbA(N%>%gurj5r?&s@(S9%P@PB@e_U5NB|}WVoTCc`5lt zLjFaG$vLSC&iO?J`9+B(K<6^E#vADsXR-mwOF k+{6;S-29YOE+^OEkoe#LS67z<8k1i@0*Qek;ko`g0IlwB3jhEB literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_3.cfe b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_3.cfe new file mode 100644 index 0000000000000000000000000000000000000000..1eeedddb0d91bd7429168f5e9a8aa7ac98762889 GIT binary patch literal 299 zcmcD&o+B>qQ<|KbmuhO@oS$2eUz(TVnpaYknOe*M1n~vO&aS#}Q;5N1^IiKReiaOy zEP81v6(A`f(1TD6!Tj+sGvW>ON-}ey;*AiRNsvV^uPg=1nFN)zM$=RPl|KuWzl|ba zkPmhb0|WC4sC+QcC3#Srn14exmxFAA3bGYJRpx-)Tms>+-Gd7Dp%|Z%p9~Ra&wIk?uOl2>_QJc zc<>@ZJ&2yQ2f>4Qs~{DM;6d;vJ$MNSdK1B3b!OVF+cwRin1Ny6ym{|??=jzdoBmSn z?!4}4)S_onS8TIldzL;<7y*10Djz<*{JfR`*WP?huTIT@G`H>#taHqEsGc!sS$8wU zWfPW8=eQT#<%S^Ff)T#K{L0|t?*dz_nfbLr0ht&p+uCg2p)^k&(;YW7#&6M1oOlqq zkdm472Is8pGQ+y#&Nv36j>Hh~b^I3~w$ExL>6NTxv1B;OyA_h87BiTioTjerIU1Gq zP(4S9qm{D6A!gp5r4}y+-?|8}iiU=zdUWj!(pH=N1kc{&P!7*~;?>kh3_QyX2ZWgD$&t1i{DRoA8V+@$6|f-iW7$n`c{ z+UUb?Pee97wfWB3FMR5-eFHNL`TpkfcLFjIK*~0ru!<6EcLzt?3MJz~zpI8uNFEiIG7L7TWikSX{4jTX*GyU8~-+}+1b&Kf- zBO~uuC~iQAX497gXo{FL(g1wb^ly-|N0kO(hiR8)E6aj*UEBJ5k}{(2)#JQ7Hr71e zk|JA@vLy*BwuWP!e=u-W#Oe#!xAT9sIaYR)ePID2fY61Xr@%f(YK+fO2*cUD#;ZT- z^zgW?iAw79Fd8_HPDGTb8f%I-A2`_3+SZ=v=W8rA4Lr=5e^YY1O Gt$zWTX_$=w literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_3.si b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/_3.si new file mode 100644 index 0000000000000000000000000000000000000000..39d782d857d44062bde77bb96df839d8c2bc3593 GIT binary patch literal 359 zcmcD&o+B>oQ<|KbmuhMdoSL4SnpfhPmzK}Kz`z(^aO~`=3pa%rJT~98KjK#b6k}io zVrCEn2pAc;I7>2fQ;SOya|?J4O-xJ-EG*3}Oe`(T__Gqr67|Y*^~zFKW@9uodT*7A2>$rsb3t zXRrgcCl)1VuvJ)?#haOkfbA(N%>%gurj5r?&s@(S9%P@PB@e_U5NB|}WVoTCc`5lt zLjFaG$vLSC&iO?J`9+B(K<6^E#T)A-rxmjTsp3osCzVki9!@3sMX4!nnW;G`#cugU kxrrrux%nxnTu!dRA@RWhuC6WzG$y}*1QG)S(|M);0JaKk;{X5v literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/segments_5 b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken/segments_5 new file mode 100644 index 0000000000000000000000000000000000000000..7a0781a26f9c8b68896a30e14ab057d0e6c0eea9 GIT binary patch literal 322 zcmcD&o+HjtoSL4SnpaZHz`(#3UvTW~stY%T7(6!LwLjul$!N;T3={_gJ|M{g!ayOW zcmqb+d&w)V*1!8R-!!XdPs39|4xiHG)Vx$v}hz)$7smP3={_gCK!X^fX3t( KFwWAD_GkbmkrKrK literal 0 HcmV?d00001 diff --git a/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamUri/write.lock b/hapi-fhir-jpaserver-base/lucene_indexes/ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamUri/write.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/ISearchDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/ISearchDao.java new file mode 100644 index 00000000000..a88683d4b8f --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/ISearchDao.java @@ -0,0 +1,11 @@ +package ca.uhn.fhir.jpa.dao; + +import ca.uhn.fhir.rest.server.IBundleProvider; + +public interface ISearchDao { + + public static final String FULL_TEXT_PARAM_NAME = "fullTextSearch"; + + IBundleProvider search(SearchParameterMap theParams); + +} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchDao.java new file mode 100644 index 00000000000..bca666da509 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchDao.java @@ -0,0 +1,53 @@ +package ca.uhn.fhir.jpa.dao; + +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.persistence.PersistenceContextType; + +import org.hibernate.search.jpa.FullTextEntityManager; +import org.hibernate.search.jpa.FullTextQuery; +import org.hibernate.search.query.dsl.QueryBuilder; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.springframework.transaction.annotation.Transactional; + +import ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString; +import ca.uhn.fhir.rest.server.IBundleProvider; + +public class SearchDao extends BaseHapiFhirDao implements ISearchDao { + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchDao.class); + + @PersistenceContext(type = PersistenceContextType.TRANSACTION) + private EntityManager myEntityManager; + + @Transactional() + @Override + public IBundleProvider search(SearchParameterMap theParams) { + + FullTextEntityManager em = org.hibernate.search.jpa.Search.getFullTextEntityManager(myEntityManager); + + for (String nextParamName : theParams.keySet()) { + if (nextParamName.equals(FULL_TEXT_PARAM_NAME)) { + QueryBuilder qb = em.getSearchFactory().buildQueryBuilder().forEntity(ResourceIndexedSearchParamString.class).get(); + org.apache.lucene.search.Query luceneQuery = qb + .keyword() + .onFields("myValueComplete") + .matching("AAAS") + .createQuery(); + + // wrap Lucene query in a javax.persistence.Query + FullTextQuery jpaQuery = em.createFullTextQuery(luceneQuery, ResourceIndexedSearchParamString.class); + + // execute search + List result = jpaQuery.getResultList(); + for (Object object : result) { + ourLog.info(""+ object); + } + } + } + + return null; + } + +} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParameterMap.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParameterMap.java index fcec4ad3bb5..6f216957039 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParameterMap.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParameterMap.java @@ -46,7 +46,6 @@ public class SearchParameterMap extends LinkedHashMap myIncludes; private DateRangeParam myLastUpdated; private Set myRevIncludes; - private SortSpec mySort; public void add(String theName, IQueryParameterAnd theAnd) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/BaseResourceIndexedSearchParam.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/BaseResourceIndexedSearchParam.java index 00e67fa3332..b32de2932e1 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/BaseResourceIndexedSearchParam.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/BaseResourceIndexedSearchParam.java @@ -30,6 +30,8 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; +import org.hibernate.search.annotations.Field; + @MappedSuperclass public abstract class BaseResourceIndexedSearchParam implements Serializable { @@ -42,6 +44,7 @@ public abstract class BaseResourceIndexedSearchParam implements Serializable { @Column(name = "SP_ID") private Long myId; + @Field @Column(name = "SP_NAME", length = MAX_SP_NAME, nullable=false) private String myParamName; @@ -49,9 +52,11 @@ public abstract class BaseResourceIndexedSearchParam implements Serializable { @JoinColumn(name = "RES_ID", referencedColumnName="RES_ID") private ResourceTable myResource; + @Field @Column(name = "RES_ID", insertable = false, updatable = false) private Long myResourcePid; + @Field @Column(name = "RES_TYPE", nullable=false) private String myResourceType; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamCoords.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamCoords.java index 2f89be47f57..a8f5cb7a7bf 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamCoords.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamCoords.java @@ -28,8 +28,11 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.search.annotations.Field; +import org.hibernate.search.annotations.Indexed; //@formatter:off +@Indexed @Entity @Table(name = "HFJ_SPIDX_COORDS" /* , indexes = { @Index(name = "IDX_SP_TOKEN", columnList = "SP_SYSTEM,SP_VALUE") } */) @org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_COORDS", indexes = { @@ -43,9 +46,11 @@ public class ResourceIndexedSearchParamCoords extends BaseResourceIndexedSearchP private static final long serialVersionUID = 1L; @Column(name = "SP_LATITUDE") + @Field public double myLatitude; @Column(name = "SP_LONGITUDE") + @Field public double myLongitude; public ResourceIndexedSearchParamCoords() { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java index 140951b433a..76d40772872 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java @@ -32,8 +32,11 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.search.annotations.Field; +import org.hibernate.search.annotations.Indexed; //@formatter:off +@Indexed @Entity @Table(name = "HFJ_SPIDX_DATE" /*, indexes= {@Index(name="IDX_SP_DATE", columnList= "SP_VALUE_LOW,SP_VALUE_HIGH")}*/) @org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_DATE", indexes= { @@ -46,15 +49,23 @@ public class ResourceIndexedSearchParamDate extends BaseResourceIndexedSearchPar @Column(name = "SP_VALUE_HIGH", nullable = true) @Temporal(TemporalType.TIMESTAMP) + @Field public Date myValueHigh; @Column(name = "SP_VALUE_LOW", nullable = true) @Temporal(TemporalType.TIMESTAMP) + @Field public Date myValueLow; + /** + * Constructor + */ public ResourceIndexedSearchParamDate() { } + /** + * Constructor + */ public ResourceIndexedSearchParamDate(String theName, Date theLow, Date theHigh) { setParamName(theName); setValueLow(theLow); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamNumber.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamNumber.java index 50d9dafabc2..acd946705d8 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamNumber.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamNumber.java @@ -30,8 +30,11 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.search.annotations.Field; +import org.hibernate.search.annotations.Indexed; //@formatter:off +@Indexed @Entity @Table(name = "HFJ_SPIDX_NUMBER" /*, indexes= {@Index(name="IDX_SP_NUMBER", columnList="SP_VALUE")}*/ ) @org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_NUMBER", indexes= { @@ -43,6 +46,7 @@ public class ResourceIndexedSearchParamNumber extends BaseResourceIndexedSearchP private static final long serialVersionUID = 1L; @Column(name = "SP_VALUE", nullable = true) + @Field public BigDecimal myValue; public ResourceIndexedSearchParamNumber() { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamQuantity.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamQuantity.java index ab824f7d109..b6bedef0aa1 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamQuantity.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamQuantity.java @@ -30,8 +30,11 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.search.annotations.Field; +import org.hibernate.search.annotations.Indexed; //@formatter:off +@Indexed @Entity @Table(name = "HFJ_SPIDX_QUANTITY" /*, indexes= {@Index(name="IDX_SP_NUMBER", columnList="SP_VALUE")}*/ ) @org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_QUANTITY", indexes= { @@ -40,15 +43,20 @@ import org.apache.commons.lang3.builder.ToStringStyle; //@formatter:on public class ResourceIndexedSearchParamQuantity extends BaseResourceIndexedSearchParam { + private static final int MAX_LENGTH = 200; + private static final long serialVersionUID = 1L; - @Column(name = "SP_SYSTEM", nullable = true, length = 100) + @Column(name = "SP_SYSTEM", nullable = true, length = MAX_LENGTH) + @Field public String mySystem; - @Column(name = "SP_UNITS", nullable = true, length = 100) + @Column(name = "SP_UNITS", nullable = true, length = MAX_LENGTH) + @Field public String myUnits; @Column(name = "SP_VALUE", nullable = true) + @Field public BigDecimal myValue; public ResourceIndexedSearchParamQuantity() { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java index 02a72893730..d13aa1df534 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java @@ -29,7 +29,10 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.search.annotations.Field; +import org.hibernate.search.annotations.Indexed; +@Indexed @Entity @Table(name = "HFJ_SPIDX_STRING"/* , indexes= {@Index(name="IDX_SP_STRING", columnList="SP_VALUE_NORMALIZED")} */) @org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_STRING", indexes = { @@ -37,16 +40,20 @@ import org.apache.commons.lang3.builder.ToStringStyle; }) public class ResourceIndexedSearchParamString extends BaseResourceIndexedSearchParam { - public static final int MAX_LENGTH = 100; + public static final int MAX_LENGTH = 200; private static final long serialVersionUID = 1L; - @Column(name = "SP_VALUE_EXACT", length = 100, nullable = true) - public String myValueExact; + @Column(name = "SP_VALUE_EXACT", length = MAX_LENGTH, nullable = true) + private String myValueExact; @Column(name = "SP_VALUE_NORMALIZED", length = MAX_LENGTH, nullable = true) - public String myValueNormalized; + private String myValueNormalized; + @Column(name="SP_VALUE_EXACT", insertable=false, updatable=false) + @Field + private String myValueComplete; + public ResourceIndexedSearchParamString() { } @@ -97,6 +104,7 @@ public class ResourceIndexedSearchParamString extends BaseResourceIndexedSearchP throw new IllegalArgumentException("Value is too long: " + theValueExact.length()); } myValueExact = theValueExact; + myValueComplete = theValueExact; } public void setValueNormalized(String theValueNormalized) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamToken.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamToken.java index c22dd0ec877..750728e4341 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamToken.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamToken.java @@ -29,21 +29,26 @@ import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.search.annotations.Field; +import org.hibernate.search.annotations.Indexed; +@Indexed @Entity @Table(name = "HFJ_SPIDX_TOKEN" /* , indexes = { @Index(name = "IDX_SP_TOKEN", columnList = "SP_SYSTEM,SP_VALUE") } */) @org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_TOKEN", indexes = { @org.hibernate.annotations.Index(name = "IDX_SP_TOKEN", columnNames = { "RES_TYPE", "SP_NAME", "SP_SYSTEM", "SP_VALUE" }), @org.hibernate.annotations.Index(name = "IDX_SP_TOKEN_UNQUAL", columnNames = { "RES_TYPE", "SP_NAME", "SP_VALUE" }) }) public class ResourceIndexedSearchParamToken extends BaseResourceIndexedSearchParam { - public static final int MAX_LENGTH = 100; + public static final int MAX_LENGTH = 200; private static final long serialVersionUID = 1L; + @Field() @Column(name = "SP_SYSTEM", nullable = true, length = MAX_LENGTH) public String mySystem; - @Column(name = "SP_VALUE", nullable = true, length = 100) + @Field() + @Column(name = "SP_VALUE", nullable = true, length = MAX_LENGTH) public String myValue; public ResourceIndexedSearchParamToken() { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java index 2a2370fcc8c..ed28bd2ad49 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java @@ -28,8 +28,12 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; +import org.hibernate.search.annotations.Analyzer; +import org.hibernate.search.annotations.Field; +import org.hibernate.search.annotations.Indexed; //@formatter:off +@Indexed @Entity @Table(name = "HFJ_SPIDX_URI" /* , indexes = { @Index(name = "IDX_SP_TOKEN", columnList = "SP_SYSTEM,SP_VALUE") } */) @org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_URI", indexes = { @@ -43,6 +47,7 @@ public class ResourceIndexedSearchParamUri extends BaseResourceIndexedSearchPara private static final long serialVersionUID = 1L; @Column(name = "SP_URI", nullable = true, length = MAX_LENGTH) + @Field() public String myUri; public ResourceIndexedSearchParamUri() { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java index 2dc12fabdc4..2286bca9b18 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java @@ -34,28 +34,22 @@ import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; +import javax.persistence.Index; import javax.persistence.OneToMany; import javax.persistence.Table; -import org.hibernate.annotations.Index; - import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; //@formatter:off @Entity -@Table(name = "HFJ_RESOURCE", uniqueConstraints = {}) -@Inheritance(strategy = InheritanceType.JOINED) -@org.hibernate.annotations.Table(appliesTo = "HFJ_RESOURCE", - indexes = { - @Index(name = "IDX_RES_DATE", columnNames = { "RES_UPDATED" }), - @Index(name = "IDX_RES_LANG", columnNames = { "RES_TYPE", "RES_LANGUAGE" }), - @Index(name = "IDX_RES_PROFILE", columnNames = { "RES_PROFILE" }), - @Index(name = "IDX_INDEXSTATUS", columnNames = { "SP_INDEX_STATUS" }) - }) +@Table(name = "HFJ_RESOURCE", uniqueConstraints = {}, indexes= { + @Index(name = "IDX_RES_DATE", columnList="RES_UPDATED"), + @Index(name = "IDX_RES_LANG", columnList="RES_TYPE,RES_LANGUAGE"), + @Index(name = "IDX_RES_PROFILE", columnList="RES_PROFILE"), + @Index(name = "IDX_INDEXSTATUS", columnList="SP_INDEX_STATUS") +}) //@formatter:on public class ResourceTable extends BaseHasResource implements Serializable { private static final int MAX_LANGUAGE_LENGTH = 20; diff --git a/hapi-fhir-jpaserver-base/src/main/resources/fhir-spring-search-config-dstu2.xml b/hapi-fhir-jpaserver-base/src/main/resources/fhir-spring-search-config-dstu2.xml new file mode 100644 index 00000000000..43ee2ce9434 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/main/resources/fhir-spring-search-config-dstu2.xml @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSearchDaoDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSearchDaoDstu2Test.java new file mode 100644 index 00000000000..3cf2db6394d --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSearchDaoDstu2Test.java @@ -0,0 +1,39 @@ +package ca.uhn.fhir.jpa.dao; + +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; + +import ca.uhn.fhir.model.dstu2.resource.Patient; +import ca.uhn.fhir.rest.param.StringAndListParam; +import ca.uhn.fhir.rest.param.StringOrListParam; +import ca.uhn.fhir.rest.param.StringParam; + +@ContextConfiguration(locations = { "classpath:fhir-spring-search-config-dstu2.xml" }) +public class FhirSearchDaoDstu2Test extends BaseJpaDstu2Test { + + @Autowired + private ISearchDao mySearchDao; + + @Test + public void testStringSearch() { + { + Patient patient = new Patient(); + patient.addIdentifier().setSystem("urn:system").setValue("001"); + patient.addName().addGiven("testSearchStringParamWithNonNormalized_h\u00F6ra"); + patient.addName().addFamily("AAAS"); + myPatientDao.create(patient); + } + { + Patient patient = new Patient(); + patient.addIdentifier().setSystem("urn:system").setValue("002"); + patient.addName().addGiven("testSearchStringParamWithNonNormalized_HORA"); + myPatientDao.create(patient); + } + + SearchParameterMap map = new SearchParameterMap(); + map.add(ISearchDao.FULL_TEXT_PARAM_NAME, new StringAndListParam().addAnd(new StringOrListParam().addOr(new StringParam("AAA")))); + mySearchDao.search(map); + } + +} diff --git a/hapi-fhir-jpaserver-base/src/test/resources/META-INF/persistence.xml b/hapi-fhir-jpaserver-base/src/test/resources/META-INF/persistence.xml index 7854e069062..16ded680252 100644 --- a/hapi-fhir-jpaserver-base/src/test/resources/META-INF/persistence.xml +++ b/hapi-fhir-jpaserver-base/src/test/resources/META-INF/persistence.xml @@ -35,6 +35,9 @@ + + +