Comments (6)
Hi guiwp,
good point, but actually I have a few other plans instead of adding search entities, but if you want to help it seems not very difficult. (Else I have to schedule this task for later.)
See:
https://www.mediawiki.org/wiki/API:Search
http://www.mediawiki.org/w/api.php (search for "Perform a full text search.")
Maybe like this:
public class Search extends TitleQuery<SearchResult> {
...
Get searchRequest = new ApiRequestBuilder().action("query") //
.formatJson() //
.paramNewContinue(mediaWikiVersion) //
.param("list", "search") //
.param("srsearch", "wikipedia") //
.param("srbackend", "CirrusSearch") // or LuceneSearch
// http://www.mediawiki.org/w/api.php?action=query&list=search
// &srsearch=wikipedia&srbackend=CirrusSearch&format=json&continue=-||
...
public class SearchResult {
final int namespace;
final String title;
final String snippet;
...
}
At JsonMapperTest.java you can find an example how to map any json response.
from jwbf.
Good answer, I found very simple and effective to start testing adding stuff into the code. But anyway, I feel that I can wait (as you said Else I have to schedule this task for later).
Thank you again :)
from jwbf.
I'm interested in adding a search function as described here.
from jwbf.
@guiwp have you tried gerhardgossen implementation? Actual without a toggle for srbackend
but maybe enough?
from jwbf.
@eldur What's the status on getting old revisions of an article? I suppose it should be implemented by adding a support for rvendid
and rvstartid
API request parameters into the GetRevision
-- or perhaps by adding a similar class dedicated only to getting specific revisions (i.e. having a List<SimpleArticle>
as its primary return type). The query itself seems to look like this: /api.php?action=query&prop=revisions&titles=TitleOfTheArticle&rvprop=timestamp|user|comment|content&rvendid=OLDER_REVISION&rvstartid=NEWER_REVISION
(switching the older and newer revisions if rvdir=newer
is given as well).
from jwbf.
@ZeroOne3010 if something is missing here send a pull request
from jwbf.
Related Issues (20)
- watch articles HOT 39
- uploaded text != downloaded text HOT 3
- MovePage with MediaWiki 1.23.2 HOT 3
- NoClassDefFound exception when instantiating classes HOT 9
- Delete Category Pages HOT 2
- connection through a proxy HOT 2
- Invalid cookie header warning HOT 1
- Implement OAuth 1.0a authentication
- Invalid XML HOT 6
- FileUpload uses wrong input for GetApiToken HOT 8
- getArticle last revision or cached version? HOT 3
- Regexp issue HOT 1
- getText receive only 10000 characters HOT 1
- Current stable version is broken with java.lang.NoSuchFieldError: DEFAULT_USER_AGENT HOT 7
- Pointless warning when using a custom HTTP client in HTTPActionClient builder HOT 1
- Bug in obtaining multiple pages at once HOT 3
- More info on Recent Changes HOT 2
- Not working in shaded jar HOT 3
- Failed to login (Fetching a token via "action=login" is deprecated)
- Incompatible with Mediawiki 1.37 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwbf.