Snippets when searching

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Snippets when searching

Manuel Fernandez Sanchez de la Blanca
Hi, all.

Is there some way of retrieving a snippet/summary of documents when performing a search?

Let me explain better.

For example, when using api.php?action=query&list=search&srwhat=text&srsearch=cvs&format=xml  ,the result  is

<api>
   <query>
      <search>
         <p ns="0" title="Instalar CVS"/>
         <p ns="0" title="Lista tareas"/>
      </search>
    </query>
</api>


And I would like to get something as:

<api>
   <query>
      <search>
         <p ns="0" title="Instalar CVS">...bla bla cvs bla bla instalar ... cvs bla bla...</p>
         <p ns="0" title="Lista tareas"/>...blabla bla lista tareas bla bla...</p>
      </search>
    </query>
</api>


Is it possible?

Thank you.





--
Manuel Fernández Sánchez de la Blanca

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Snippets when searching

Roan Kattouw
Manuel Fernandez Sanchez de la Blanca schreef:

> Hi, all.
>
> Is there some way of retrieving a snippet/summary of documents when
> performing a search?
>
> Let me explain better.
>
> For example, when using
> /api.php?action=query&list=search&srwhat=text&srsearch=cvs&format=xml  
> ,/the result  is
>
> /<api>
>    <query>
>       <search>
>          <p ns="0" title="Instalar CVS"/>
>          <p ns="0" title="Lista tareas"/>
>       </search>
>     </query>
> </api>/
>
> And I would like to get something as:
>
> /<api>
>    <query>
>       <search>
>          <p ns="0" title="Instalar CVS">...bla bla *cvs *bla bla
> *instalar *... *cvs *bla bla...</p>
>          <p ns="0" title="Lista tareas"/>...blabla bla *lista tareas*
> bla bla...</p>
>       </search>
>     </query>
> </api>/
>
> Is it possible?
You can't get snippets, but you can get the entire page content with

api.php?action=query&generator=search&gsrwhat=text&gsrsearch=cvs&prop=revisions&rvprop=content

Roan Kattouw (Catrope)

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Snippets when searching

Manuel Fernandez Sanchez de la Blanca
The entire content is very much for my purposes, but thank you anyway :)


--
Manuel Fernández Sánchez de la Blanca

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Snippets when searching

Platonides
Manuel Fernandez Sanchez de la Blanca escribió:
> The entire content is very much for my purposes, but thank you anyway :)
>
>
> --
> Manuel Fernández Sánchez de la Blanca

Maybe you can by using the files named at download.wikimedia.org as
abstract.xml? Not sure about how they're being generated, though.

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api