Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:58:18+00:00 2026-05-23T11:58:18+00:00

When I execute the following fulltext query that searches across two tables and two

  • 0

When I execute the following fulltext query that searches across two tables and two indexes I get duplicate data. I actually just figured out why BUT I do not know how to fix it. When I search for testl I get 4 duplicates, because there are 4 tags in the other joined table that is indexed. If I search for some new upload, I get 2 duplicates for the same reason. Anyone know how I can resolve this?

CREATE TABLE IF NOT EXISTS `video` (
  `timestamp` int(11) NOT NULL,
  `vid_id` varchar(32) NOT NULL,
  `file_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `uploader` varchar(55) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `title` varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `subject_id` int(1) NOT NULL,
  FULLTEXT KEY `title` (`title`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `video`
--

INSERT INTO `video` (`timestamp`, `vid_id`, `file_name`, `uploader`, `title`, `subject_id`) VALUES
(1309290471, 'qcids3qhf95651wp2278f28w2crktaso', '7b682476bfb617a9ca889205c2a11efe', 'geoff', 'untitled', 1),
(1309290896, '6webkscr3pcc7knkg2zm29gkn4fp4eme', '14f5187c74f82b3fe7e4eaf4c3805eee', 'geoff', 'untitled', 1),
(1309291000, 's316v2k9vto73u4b7ap2gv51xr2emmh5', 'e01c5b9c1434330f0e7c2e50a00b2b7a', 'geoff', 'Testl', 7),
(1309299362, 'rdkz0twhvwr2j9mtfhqrrtrh311exhmm', 'e4261879a4f96a0eed3c5f4146bde7e8', 'geoff', 'Some new upload', 6);

CREATE TABLE IF NOT EXISTS `tags` (
  `id` varchar(35) NOT NULL,
  `vid_id` varchar(35) NOT NULL,
  `name` varchar(45) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  UNIQUE KEY `vid_id` (`vid_id`,`name`),
  FULLTEXT KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `tags`
--

INSERT INTO `tags` (`id`, `vid_id`, `name`) VALUES
('c37c449f6677e7980b5f6461efdfacfc', 's316v2k9vto73u4b7ap2gv51xr2emmh5', 'cool'),
('472b9aa1b863e4768eb27fcd19072e5b', 's316v2k9vto73u4b7ap2gv51xr2emmh5', 'o'),
('203c1490e86d734e2674b973a1bd1e26', 's316v2k9vto73u4b7ap2gv51xr2emmh5', 'yea'),
('aff5ec90a82fb22217ce32125e80b54e', 's316v2k9vto73u4b7ap2gv51xr2emmh5', 'p'),
('dd226125d0eaf0c89b06d0d5589ec7a0', 'rdkz0twhvwr2j9mtfhqrrtrh311exhmm', 'hot'),
('40fff048a8bd684eb946ff8400c0a653', 'rdkz0twhvwr2j9mtfhqrrtrh311exhmm', 'hos');

SELECT video.*,
  MATCH(video.title) AGAINST(? IN BOOLEAN MODE) as cscore, 
  MATCH(tags.name) AGAINST(? IN BOOLEAN MODE) as htscore
FROM video
LEFT JOIN tags ON video.vid_id=tags.vid_id
WHERE
  MATCH(video.title) AGAINST(? IN BOOLEAN MODE) OR
  MATCH(tags.name) AGAINST(? IN BOOLEAN MODE)
ORDER BY cscore DESC;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:58:19+00:00Added an answer on May 23, 2026 at 11:58 am

    I think using

    SELECT DISTINCT video.*,
    

    etc

    should do the trick


    Actually, no sorry not with

    MATCH(tags.name) AGAINST(? IN BOOLEAN MODE) as htscore
    

    You might need to do something like SUM() the htscore and GROUP BY the video.* columns

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I execute the following query, I get an exception telling me that 'feedItemQuery'
I want to execute following query: from Item i where i.categoryItems.catalogId = :catId That
When I execute the following query on a database containing a table comm_list and
While trying to execute the following lines only the last two statements are displayed(Here
I am trying to execute the following query. update share set holder = 22
When I try to execute following query: SELECT id_subscriber INTO newsletter_to_send FROM subscribers I
When I execute the following java program, sometimes I get an empty response ,
When I execute the following code, I get ConcurrentModificationException Collection<String> myCollection = Collections.synchronizedList(new ArrayList<String>(10));
I tried to execute the following query: RESTORE DATABASE TESTDB FROM DISK = <path
When I execute the following program it get the user input for account details

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.