如何使用高级参数执行Twitter搜索

时间:2021-01-10 15:03:01

http://twitter.com/search-advanced

I would like to perform search queries which mimic the above screen (e.g. How do I find all tweets which satisfy "none of the words" criteria or just #hashtags criteria). Would it be possible to mix-n- match some of these fields using twitter4j, currently I am able to perform only simple searches using keywords.

我想执行模仿上述屏幕的搜索查询(例如,我如何查找满足“无单词”标准或仅满足#hashtags标准的所有推文)。是否可以使用twitter4j混合匹配其中一些字段,目前我只能使用关键字执行简单搜索。

1 个解决方案

#1


3  

If you fill out some of the advanced search page and actually do the search, it'll populate a search box with the constructed query string. For example, if I set it up as follows:

如果您填写一些高级搜索页面并实际进行搜索,它将使用构造的查询字符串填充搜索框。例如,如果我按如下方式设置它:

  • All of these words: word1 word2
  • 所有这些词:word1 word2

  • Any of these words: word3 word4
  • 任何这些词:word3 word4

  • None of these words: word5
  • 这些词都不是:word5

  • From these accounts: user1 user2
  • 从这些帐户:user1 user2

  • Mentioning these accounts: user3
  • 提到这些帐户:user3

"word1 word2 word3 OR word4 -word5 from:user1 OR from:user2 @user3"

“word1 word2 word3或word4 -word5 from:user1或from:user2 @ user3”

Then you just stick that string into your created query.

然后你只需将该字符串粘贴到您创建的查询中。

Query query = new Query("word1 word2 word3 OR word4 -word5 from:user1 OR from:user2 @user3");

#1


3  

If you fill out some of the advanced search page and actually do the search, it'll populate a search box with the constructed query string. For example, if I set it up as follows:

如果您填写一些高级搜索页面并实际进行搜索,它将使用构造的查询字符串填充搜索框。例如,如果我按如下方式设置它:

  • All of these words: word1 word2
  • 所有这些词:word1 word2

  • Any of these words: word3 word4
  • 任何这些词:word3 word4

  • None of these words: word5
  • 这些词都不是:word5

  • From these accounts: user1 user2
  • 从这些帐户:user1 user2

  • Mentioning these accounts: user3
  • 提到这些帐户:user3

"word1 word2 word3 OR word4 -word5 from:user1 OR from:user2 @user3"

“word1 word2 word3或word4 -word5 from:user1或from:user2 @ user3”

Then you just stick that string into your created query.

然后你只需将该字符串粘贴到您创建的查询中。

Query query = new Query("word1 word2 word3 OR word4 -word5 from:user1 OR from:user2 @user3");