Page 1


! " #$ % – & '(( & ( – ) *+ – # # , . / – )0 .+ # – 1 – 1 " – # #2 344

&-

.

, 2


5

0 .

– 6 57( – 7 , – ! – < = ! !

# 5 89 :; - " 857 & / # & ! >? @ =

3


#$ % – – ! – 7$ % – 7$ % – A – 7$ % –

. 0# + -0

, .

0 .

.

/ 0&

"

% >

#$ %

#

" ;

4


& – ,+ B – ,+ B

& ,'

, , C ,+D , C 3 D

; – – – – – – – – –

& & & & & & & & &

E E ;E ;E ! ! F & ! &G E % G &: E

E & E E 5


; – >H

" - #

.

0

"

"

.

/. $

(

. $

.

. –

H

;-

I J

H

/E

! F –

! F

!

-

& .G

– G %K G – : &K !

/E

.G &

-% &-%/E

.: .0 .

; /E 6


– 6

"

7


6

! '

#$ %

,

L H

' + !E

6

'

+

#, !

;

< !'

.

-

/ ;

+

#2 % < ! &

# .

, 8


IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true); // arg 3 indica crear // si false se a単ade ... // para cada documento Document doc = new Document(); doc.add(Field.UnIndexed("url", url)); doc.add(Field.UnStored("content",contenidoURL)); writer.addDocument(doc); ... writer.close(); 9


IndexSearcher is = new IndexSearcher("index"); QueryParser qp = new QueryParser(â&#x20AC;&#x153;contents", new StandardAnalyzer()); // arg1 es campo por defecto qp.setOperator(qp.DEFAULT_OPERATOR_AND); // por defecto es OR Query query = qp.parse(queryString); Hits hits = is.search(query,Sort.RELEVANCE); for (int i=0; i< hits.length(); i++) { Document doc = hits.doc(i); System.out.println(doc.get("url"); }

10


<2 M A – –

7$ % 3 7$ % ! O

N 1 . AO. 1A<. 4. >.

" 0

AO-

#

/

2

2

#

'+ Q

.

0

P 0 0; ; R. R S # / M2 NR8 'I 8 8<A ? 8 8J " 2 ,T UV 11


'W<& O & F W 1 !' ' & W,T & WR8 W,T & WUVW & -,T AO &/ 1 H # '-4 4W T & W/

M

12


& '(( & (,+( ( !& & '(( & (,+( ( ( !& & '((HHH , ( (H T (P & K XX X X & '((HHH ,+ & ( H ( V V( & & '((HT & (,T > (O # ) T: & . A YE 5 # E # V

13

nada  

proba para si funciona